How do I debug VB error #80004005

G

Guest

According to my research, VB error 80004005 (-2147467259) is an "Unspecified
Error" - which isn't exactly helpful <grrr>. The error description in the VB
error pop-up is a bit better, giving "Method 'Open' of object '_Recordset'
failed" (I mean "very little bit" better <sigh>).

Here's the (pared down) code fragment (the error shows up on the Open method):


Private Sub Button1_Click()

Dim recset As ADODB.Recordset
Set recset = New ADODB.Recordset

With recset
.ActiveConnection = CurrentProject.connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic

.Open Source:="SELECT * from Names" '', Options:=adCmdText
'' ^
'' |
'' +---- Error on this line

End With

End Sub

I'm running Access 6 (11.5614.5606) with VB 6.3


ALL HELP WELCOME!
 
J

John Nurick

The pair of apostrophese seems wrong:

Source:="SELECT * from Names" '',

What happens if you delete them?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top