G
Guest
Hi I am new to Data Access Pages and I have managed to create some simple web
forms based on tables and queries with little difficulty.
What I need to do now is create a recordset. I have used the code from msdn
as a starting point and get an error : "Microsoft Office Data Source Control
10.0: the "0" object cannot be found"
the problem seems to be as a result of this line:
strShapeText = MSODSC.RootRecordsetDefs(0).ShapeText
the full code is:
Dim rs
Dim strShapeText
Dim strConnString
Dim strDataSource
adOpenKeyset=1
adLockOptimistic=3
strDataSource = "C:\Folder1\DB1.mdb"
strShapeText = MSODSC.RootRecordsetDefs(0).ShapeText
strConnString = "Provider=MSDataShape.1; Persist Security
Info=False;Data Source=" _
& strDataSource & ";User ID=Admin;Data
Provider=Microsoft.Jet.OLEDB.4.0"
Set rs = CreateObject("ADODB.Recordset")
rs.open strShapeText, strConnectionString, adOpenKeyset,
adLockOptimistic
If err.Number <> 0 Then
MsgBox "Error: " & err.description & "Error " & err.number
End If
MSODSC.SetRootRecordset "query1", rsThemes
Any help will be greatly appreciated.
Thanks, Neal.
forms based on tables and queries with little difficulty.
What I need to do now is create a recordset. I have used the code from msdn
as a starting point and get an error : "Microsoft Office Data Source Control
10.0: the "0" object cannot be found"
the problem seems to be as a result of this line:
strShapeText = MSODSC.RootRecordsetDefs(0).ShapeText
the full code is:
Dim rs
Dim strShapeText
Dim strConnString
Dim strDataSource
adOpenKeyset=1
adLockOptimistic=3
strDataSource = "C:\Folder1\DB1.mdb"
strShapeText = MSODSC.RootRecordsetDefs(0).ShapeText
strConnString = "Provider=MSDataShape.1; Persist Security
Info=False;Data Source=" _
& strDataSource & ";User ID=Admin;Data
Provider=Microsoft.Jet.OLEDB.4.0"
Set rs = CreateObject("ADODB.Recordset")
rs.open strShapeText, strConnectionString, adOpenKeyset,
adLockOptimistic
If err.Number <> 0 Then
MsgBox "Error: " & err.description & "Error " & err.number
End If
MSODSC.SetRootRecordset "query1", rsThemes
Any help will be greatly appreciated.
Thanks, Neal.