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

Variable not passing to sql - code attached

Status
Not open for further replies.

gcole

Programmer
Aug 2, 2000
390
US
I am having trouble passing a variable to a SQL statement.
The address of the window is "I need the 1582a in an sql statment. This is my code:

<script LANGUAGE=&quot;JavaScript&quot; RUNAT=&quot;server&quot;>
function _initrstWO()
{
//get address variable
var m_wo = request(&quot;wonum&quot;)
var DBConn = Server.CreateObject('ADODB.Connection');
DBConn.ConnectionTimeout = Application('ConnWO_ConnectionTimeout');
DBConn.CommandTimeout = Application('ConnWO_CommandTimeout');
DBConn.CursorLocation = Application('ConnWO_CursorLocation');
DBConn.Open(Application('ConnWO_ConnectionString'),
Application('ConnWO_RuntimeUserName'),
Application('ConnWO_RuntimePassword'));
var cmdTmp = Server.CreateObject('ADODB.Command');
var rsTmp = Server.CreateObject('ADODB.Recordset');
cmdTmp.ActiveConnection = DBConn;
rsTmp.Source = cmdTmp;
cmdTmp.CommandType = 1;
cmdTmp.CommandTimeout = 30;
//pass m_wo to sql
cmdTmp.CommandText = 'SELECT calls.*, workorderNum AS wo1 FROM calls WHERE
workorderNum = &quot; & m_wo & &quot; ;'
rsTmp.CacheSize = 100;
rsTmp.CursorType = 3;
rsTmp.CursorLocation = 3;
rsTmp.LockType = 3;
rstWO.setRecordSource(rsTmp);
rstWo_Open();

Is my problem with the variable passed to the form or the sql code?
Thanks,
Gail [sig][/sig]
 
This problem has been solved. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top