954,559 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

passing variable in sql error(pls help)

good day!

I want to pass the value that contains tha table name and load its data.But my sql turns error.Below is my code.

Combo2.Text = "first_year"

sql = "select * from " & Combo2.Text & "'"
        rs.Open sql, conn, adOpenKeyset, adLockOptimistic, adCmdText

Im using mysql as backend database.

Pls help.God bless on this mother earth.

Thank you for your time.!

blocker
Posting Whiz in Training
232 posts since Jan 2009
Reputation Points: 7
Solved Threads: 1
 
sql = "select * from " & Combo2.Text & "'"

You don't need tick on the end.

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 
sql = "select * from " & Combo2.Text & "'"

You don't need tick on the end.

Good Luck

thank you sir. This problem was solved.

blocker
Posting Whiz in Training
232 posts since Jan 2009
Reputation Points: 7
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You