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!

Inserting a string variable into sql query in vba

Status
Not open for further replies.

kdjonesmtb2

Technical User
Nov 19, 2012
93
US
Hello,

I would like to insert a string variable from a datatable into the result of sql query in vba
dt_test_casenumber=trim(datatable("Test_Case_Number",dtGlobalSheet))
set rs602 = connB.execute("select * from #cpt_variance")
query = replace(query,"$TestCaseNumber$",dt_test_casenumber)

What is the correct syntax for combining the setrs602 command line with replace?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top