•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,526 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,807 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1245 | Replies: 6 | Solved
![]() |
hi.im facing an error that says 'syntax error in FROM clause'.i dont know where i went wrong because it used to run smoothly.from my research about this error,it seems each solution is unique,it doesnt relate to what im doing.can anyone please help?here are my codes:
Private Sub Cmd_Login_Click()
Adodc1.RecordSource = "SELECT * FROM User Where user_name='" & Txt_Name.Text & "'"
Adodc1.Recordset.Requery
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then 'user doesnt exist
MsgBox "Bad Username! Try again."
Exit Sub 'so that it won't move on checking the password
End If
'user exist,check password
If Adodc1.Recordset.Fields("password") = Txt_Pass.Text Then
If Adodc1.Recordset.Fields("user_status") = "admin" Then 'check user status
'current_user = Adodc1.Recordset.Fields("user_name").Value
MsgBox "Login Successful!"
Unload Me
A2_AdminMain.Show 'login Admin Page
Else
current_user = Adodc1.Recordset.Fields("user_name").Value
MsgBox "Login Successful!"
Unload Me
A2_UserMain.Show 'login user page
End If
Else 'Wrong Password
MsgBox "Wrong password. Try again."
End If
End Sub•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,166
Reputation:
Rep Power: 7
Solved Threads: 59
Try this:
If that doesn't work, check the table name 'User' is correct in your database.
Adodc1.RecordSource = "SELECT * FROM [User] Where user_name='" & Txt_Name.Text & "'"If that doesn't work, check the table name 'User' is correct in your database.
•
•
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,444
Reputation:
Rep Power: 4
Solved Threads: 87
•
•
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,444
Reputation:
Rep Power: 4
Solved Threads: 87
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- syntax error in FROM clause (Java)
- Syntax error in FROM clause. (VB.NET)
- Help with syntax error (ASP)
- syntax error that I just can't seem to find! (Visual Basic 4 / 5 / 6)
- UPDATE syntax error (MySQL)
- Subshell Problem, syntax error...Help please! (Shell Scripting)
- DECLARATION SYNTAX ERROR (for bc 31 user) (C++)
- Parse error, syntax error, Forbids declaration (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: how can i create a dockable form in mdiform
- Next Thread: multiple search



Linear Mode