1: Convert String to Upper/Lower Case:
2: <%
3: Function PCase(strInput)
4:
5: Dim iPosition
6: Dim iSpace
7: Dim strOutput
8:
9: iPosition = 1
10:
11: Do While InStr(iPosition, strInput, " ", 1) <> 0
12: iSpace = InStr(iPosition, strInput, " ", 1)
13: strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
14: strOutput = strOutput &
15: LCase(Mid(strInput, iPosition + 1, iSpace - iPosition))
16: iPosition = iSpace + 1
17: Loop
18: strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
19: strOutput = strOutput & LCase(Mid(strInput, iPosition + 1))
20: PCase = strOutput
21: End Function
22: %>
1: Private Sub Form_Load()
2: Dim FSO
3: Dim ATT
4: Set FSO = CreateObject("Scripting.FileSystemObject")
5: Set ATT = FSO.GetFile(Me.Application.CurrentProject.Path &
6: "\UPS_DATA_CREATER.mdb")
7:
8: ATT.Attributes = 0
9: End Sub
10: where "\UPS_DATA_CREATER.mdb" = to application name
1: Sub RefreshLinks()
2: Dim cat As ADOX.Catalog
3: Dim tbl As ADOX.Table
4: Set cat = New ADOX.Catalog
5: cat.ActiveConnection = CurrentProject.Connection
6: Set tbl = New ADOX.Table
7: For Each tbl In cat.Tables
8: If tbl.Type = "LINK" Then
9: tbl.Properties("Jet OLEDB:Link Provider String")
10: = "MS Access;PWD=Admin;"
11: End If
12: Next
13: End Sub
1: loop thru all the tables in a database without knowing the names."
2:
3:
4: dim oConn, oRSTbl
5:
6: '
7: ' Open the object that we'll need.
8: '
9: set oConn = CreateObject ("ADODB.Connection")
10: set oRSTbl = CreateObject ("ADODB.Recordset")
11: oConn.open "DSN=MyDSN;
12:
13: '
14: ' Pass 20 to the function for Tables.
15: '
16: set oRSTbl = oConn.OpenSchema (20)
17:
18: '
19: ' Fly down our schema and generate a message
20: ' for each table we find
21: '
22: while not oRSTbl.eof
23: MsgBox "Table is [" + oRSTbl ("TABLE_NAME") + "]"
24: oRSTbl.movenext
25: wend
26:
27:
1: loop thru all the sites on an IIS server."
2: Dim IISOBJ, WebSite
3: Set IISOBJ = GetObject("IIS://Localhost/W3SVC")
4: For each WebSite in IISOBJ
5: if (WebSite.Class = "IIsWebServer") then
6: MsgBox WebSite.ServerComment + "("_
7: + GetPath (WebSite) + ")"
8: end if
9: Next
10:
11: Function GetPath (WebSite)
12: Dim Root, NewADSPath, Path
13: Set Root = GetObject(WebSite.ADSPath & "/ROOT")
14: GetPath = lcase(Root.Path)
15: End Function
16:
17:
db2Connection.ConnectionString = "Provider-MSDASQL.1;Persist Security Info=False;Data Source=DSNAS400DB2;Mode=ReadWrite"