turnknuckle
11-05-2002, 10:37 PM
Greetings
Im having a problem posting a values/s from a form to an asp script; if i give the script a literal value for strFirmType ie. strFirmType = "Stock Finance" it connects to the db fine and displays the records, but when i try to get a value for strFirmType from my form it gives me:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
and points to the line that reads: RS.Open strSQL, strCon
Any Ideas???
Turnknuckle...
<form name "search_form" method = "post" action = "simpler_search.asp">
Set DB = Server.CreateObject ("ADODB.Connection")
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("fin_prov.mdb")
strFirmType = Request.Form("firm_type")
DB.Open strCon
Set RS = Server.CreateObject ("ADODB.Recordset")
If strFirmType = "Stock Finance" Then
strSQL = "SELECT * FROM stock_finance;"
End if
RS.Open strSQL, strCon
If RS.EOF And RS.BOF Then
Response.Write "no records"
Else
Do While not RS.EOF
Response.Write ("<br>")
Response.Write ("<b>company: </b>")
Response.Write (RS("company"))
Response.Write ("<br>")
Response.Write ("<b>contact: </b>")
Response.Write (RS("contact"))
Response.Write ("<br>")
Response.Write ("<b>tel_number: </b>")
Response.Write (RS("tel_number"))
Response.Write ("<br>")
Response.Write ("<b>address: </b>")
Response.Write (RS("address"))
Response.Write ("<br>")
Response.Write ("<b>Email: </b>")
Response.Write (RS("email"))
Response.Write ("<br>")
Response.Write ("<b>web: </b>")
Response.Write (RS("web"))
Response.Write ("<br>")
Response.Write ("<b>min_invest: </b>")
Response.Write (RS("min_invest"))
Response.Write ("<br>")
Response.Write ("<b>max_invest: </b>")
Response.Write (RS("max_invest"))
Response.Write ("<br>")
Response.Write ("<b>firm_type: </b>")
Response.Write (RS("firm_type"))
Response.Write ("<br>")
Response.Write ("<b>ind_pref: </b>")
Response.Write (RS("ind_pref"))
Response.Write ("<br>")
Response.Write ("<b>geog_pref: </b>")
Response.Write (RS("geog_pref"))
Response.Write ("<br>")
Response.Write ("<br>")
'Move to the next record in the recordset
RS.MoveNext
Loop
End if
Im having a problem posting a values/s from a form to an asp script; if i give the script a literal value for strFirmType ie. strFirmType = "Stock Finance" it connects to the db fine and displays the records, but when i try to get a value for strFirmType from my form it gives me:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
and points to the line that reads: RS.Open strSQL, strCon
Any Ideas???
Turnknuckle...
<form name "search_form" method = "post" action = "simpler_search.asp">
Set DB = Server.CreateObject ("ADODB.Connection")
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("fin_prov.mdb")
strFirmType = Request.Form("firm_type")
DB.Open strCon
Set RS = Server.CreateObject ("ADODB.Recordset")
If strFirmType = "Stock Finance" Then
strSQL = "SELECT * FROM stock_finance;"
End if
RS.Open strSQL, strCon
If RS.EOF And RS.BOF Then
Response.Write "no records"
Else
Do While not RS.EOF
Response.Write ("<br>")
Response.Write ("<b>company: </b>")
Response.Write (RS("company"))
Response.Write ("<br>")
Response.Write ("<b>contact: </b>")
Response.Write (RS("contact"))
Response.Write ("<br>")
Response.Write ("<b>tel_number: </b>")
Response.Write (RS("tel_number"))
Response.Write ("<br>")
Response.Write ("<b>address: </b>")
Response.Write (RS("address"))
Response.Write ("<br>")
Response.Write ("<b>Email: </b>")
Response.Write (RS("email"))
Response.Write ("<br>")
Response.Write ("<b>web: </b>")
Response.Write (RS("web"))
Response.Write ("<br>")
Response.Write ("<b>min_invest: </b>")
Response.Write (RS("min_invest"))
Response.Write ("<br>")
Response.Write ("<b>max_invest: </b>")
Response.Write (RS("max_invest"))
Response.Write ("<br>")
Response.Write ("<b>firm_type: </b>")
Response.Write (RS("firm_type"))
Response.Write ("<br>")
Response.Write ("<b>ind_pref: </b>")
Response.Write (RS("ind_pref"))
Response.Write ("<br>")
Response.Write ("<b>geog_pref: </b>")
Response.Write (RS("geog_pref"))
Response.Write ("<br>")
Response.Write ("<br>")
'Move to the next record in the recordset
RS.MoveNext
Loop
End if