|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Searching where form variable equals data field
Please tell me what I am doing wrong. I get a "data type mismatch error". I assume it is because this is a number, but I don't know what to change.
<% dim cnStr dim rcSet dim frmSSN dim sqlStr 'store form input into variables frmSSN = Request.Form("SSN") 'create connection and recordset objects Set cnStr = Server.CreateObject("ADODB.Connection") Set rcSet = Server.CreateObject("ADODB.Recordset") ' defining database connection (connectionstring2.inc) cnStr.ConnectionString = path cnStr.Provider = provider cnStr.open %> <% SQL_query = "SELECT * FROM Orders WHERE Driver = '" & frmSSN & "'" Set RS = cnStr.Execute(SQL_query) WHILE NOT RS.EOF %> |
|
#2
|
|||
|
|||
|
does the error occur when you try to execute the sql? if Driver is a numeric field in the database then remove the single quotes that enclose the value.
__________________
Programmer's Corner |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Searching where form variable equals data field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|