Changing Sql In Ado Query

jaydwest

JayW
Local time
Today, 06:24
Joined
Apr 22, 2003
Messages
340
I would like to change the SQL (commandtext) behind an ADO Query. Here's the code I use.

Set cmd = MakeCommand(gbCnnUserDB, "MTDNewSales_2_SelQry", adCmdStoredProc)

mySQL = "SELECT MTDNewSales_1_SelQry.IsMobileHome, MTDNewSales_1_SelQry.ActualClosingDate, MTDNewSales_1_SelQry.AssetId " _
& "FROM MTDNewSales_1_SelQry " _
& "WHERE (MTDNewSales_1_SelQry.ActualClosingDate Between #" & datSOM & "# And #" & datToDate & "#); "

cmd.CommandText = mySQL

The MakeCOmmand function sets the command to the named query "MTDNewSales_2_SelQry"

THe SQL is not being updated. What do I have to do to update the SQL.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom