How about this...
'==============================
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
strUserName = "username"
strPassword = "password"
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "DSN=YourDSNNameHere;", strUserName, strPassword
objRecordset.CursorLocation = adUseClient
objRecordset.Open "SELECT * FROM tblYourTableNameHere" , _
objConnection, adOpenStatic, adLockOptimistic
Do While Not objRecordSet.EOF
<Your statements>
Loop
objRecordset.Close
objConnection.Close
'============================================
This requires that you set up a system DSN first. I can give you the code to automate that, or you can do it manually.
Hope this helps.
mmcdonal
|