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

Passing a variable to a query

Status
Not open for further replies.

EdLentz

Technical User
Mar 20, 2002
85
US
I have a MS Access 2000 front end (just creating) and I want to delete a record from my MySql db backend. I get a network connection failure when I try to use the usual method. I have a ODBC link established. So I would like to pass a ID number for the record to the Query to delete it from the backend. Any examples would be appreciated.

Thanks
Ed
 
Run a pass-through query in MS Access and execute a


delete from tablename where ID = x



Bye


Qatqat

Life is what happens when you are making other plans.
 
You would have to concactinate the variable into your query.

E.g.

String VARIABLE = "00001"

"delete from TABLENAME where ID = \""+VARIABLE+"\""
so the above query would in actual fact yield

"delete from TABLENAME where ID = "00001"

The plus(+) sign is the concactination character.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top