Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert DAO workspace to ADO - Possible???

Status
Not open for further replies.

emuti

MIS
Apr 18, 2001
37
US
DOes anyone know how to change DAO workspace to ADO?? Here's a snapshot of the code I want to change:

Dim I As Integer
Dim J As Integer, K As Integer
Dim N As Integer
Dim wks As Workspace
Dim dbs As Database
Dim rst As Recordset

On Error GoTo ErrorHandler
N = 0
Set wks = DBEngine.Workspaces(0)
I = wks.Users(Me.ComboUser).Groups.Count
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset(TableGroupUser, dbOpenDynaset)
With rst
For J = 0 To I - 1
.Find "GroupName = " & "'" & wks.Users(Me.ComboUser).Groups(J).Name & "'" & " AND UserID = " & "'" & Me.ComboUser & "'"
If .NoMatch Then
.AddNew
!GroupName = wks.Users(Me.ComboUser).Groups(J).Name
!UserID = Me.ComboUser
!OperatorStamp = SetCurrentUserID
!DateTimeStamp = Now()
.Update
N = N + 1
End If
Next J

Thanks in advance!!

 
Hi.

The workspace appears to be JET, not DAO. but you are using DAO to access the data in the jet workspace.

In Access 2000 there is fairly good help on changing from DAO to ADODB.

Start with:
1. backup
2. setup a reference to Microsoft ActiveX Data Objects ..., and remove the existing reference to Microsoft DAO 2.5 Compatability Library

You should now have access to the ADO help stuff, enter
dim rst as ADOBD.Recordset
put your cursor on ADODB and press F1. heaps to learn here.

Gzep.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top