1,105,578 Community Members

*syntax error in from clause* vb6 connect with ms access error

Member Avatar
yeeitsneo
Light Poster
41 posts since Sep 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

hi. can you please help me out with this program im writing.
its a simple log in system written in vb6 .
ms access is my database.
i have a problem with connecting vb to access.


heres the code:

/codes for module
Public db As ADODB.Connection
Public rec As ADODB.Recordset

Sub connect()
    Set db = New Connection
    db.CursorLocation = adUseClient
    db.Open "Provider = Microsoft.jet.OLEDB.4.0;data source = letmein.mdb;persist security info = false"
    
End Sub


/codes for the form
Private Sub Form_Load()
connect
sql = "select * from user"
Set rec = New Recordset
rec.Open sql, db, adOpenDynamic, adLockBatchOptimistic
End Sub
Member Avatar
debasisdas
Posting Genius
6,542 posts since Feb 2007
Reputation Points: 580 [?]
Q&As Helped to Solve: 476 [?]
Skill Endorsements: 25 [?]
Featured
 
0
 

try to rename the table to something else.

USER is predefined keyword.

Member Avatar
yeeitsneo
Light Poster
41 posts since Sep 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

try to rename the table to something else.

USER is predefined keyword.

thank you so much sir!
:D im new to this.
thaaanks! :)

Question Answered as of 2 Years Ago by debasisdas
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: