Hi, there
I have a problem in Access modules, I need your help!!!
I made a function like this:
Dim cnn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set cnn = CurrentProject.Connection
SQL = "select * from queryA where..."
rst.Open SQL, cnn, adOpenStatic, adLockReadOnly
.......
if I set queryA retrive data from a table ,it works well,but if i set QueryA retrive data from two table -make QueryA as a Union Query, I got runtime error:"mathod'open' of object'-recordset' failed."
I check the union query ,everything is ok and no problem in field name.I don't know where the problem is,if some one has any clue about it ,let me know, Thanks in advance.
I have a problem in Access modules, I need your help!!!
I made a function like this:
Dim cnn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set cnn = CurrentProject.Connection
SQL = "select * from queryA where..."
rst.Open SQL, cnn, adOpenStatic, adLockReadOnly
.......
if I set queryA retrive data from a table ,it works well,but if i set QueryA retrive data from two table -make QueryA as a Union Query, I got runtime error:"mathod'open' of object'-recordset' failed."
I check the union query ,everything is ok and no problem in field name.I don't know where the problem is,if some one has any clue about it ,let me know, Thanks in advance.