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

Varible for Table Name

Status
Not open for further replies.

DaveOLW

Programmer
Nov 21, 2005
2
GB
In VB project ADODB Database How do I use a variable for the Table Name?

In the code below the "SUC_85" is the table name, I want to use a variable in this position to save writing a lot more code.

rcsInfo_Open "Select * from SUC_85 Order By ID", conInfo, adOpenDynamic, adLockOptimistic
 
something like this should work:



rcsInfo_Open "Select * from " & tableNameVariable & " Order By ID", conInfo, adOpenDynamic, adLockOptimistic

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Leslie

Yes that works Thanks, had searched and could not find I knew there must be a simple solution. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top