Home > Software engineering >  For the first time to use own vba in the access database operation prompt the user defined type unde
For the first time to use own vba in the access database operation prompt the user defined type unde

Time:10-01

Wrote in a word, can prompt Dim Rs As New ADODB. Recodset user-defined types undefined

The code is a line of

Option Compare Database
Sub (tt)
Dim Rs As New ADODB. Recodset


End Sub


Online a lot of people say it's the problem of reference (tools - reference) I have quoted the Microsoft ActiveX Data Objects Library 2.8, the key is I changed three machines are suggested such mistakes,

The present system is Windows 2003 + office 2010

Master for help, in addition to reference, also have to do what operation

CodePudding user response:

Dim the Rs As New ADODB. Recodset
Spelling mistakes!!!!!!
The right should be the following:
Dim the Rs As New ADODB. You

CodePudding user response:

Thank you upstairs, write wrong indeed,

Dim cn As New ADODB. Connection
Dim the Rs As New ADODB. You
StrSQL="select * from physical site number"
Rs. The Open strSQL, CurrentProject Connection, adOpenDynamic, adLockOptimistic, adCmdText
If Not Rs. BOF And Not Rs. EOF Then
StrSQL="insert into need to generate the summary table tt (physical site number) values (Rs! Physical site number)
"CurrentProject. Connection. The Execute strSQL
End the If

This statement Rs! Physical site number if changing constants is right, as the Rs! Physical site number is wrong, where there is a problem?
  •  Tags:  
  • VBA
  • Related