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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

method 'open' failed!!!

Status
Not open for further replies.

rgao

Technical User
Feb 1, 2002
38
CA
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top