|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Execution of SQL Request : problem of Recordset
I have got a problem executing a query.
The driver indicates an error in Internet Explorer : No value given for one or more required parameters It refers to the recordset definition. I have tested the query in my DBMS, it works. SOURCE : Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= " & server.mappath (BDname) " Dim StrSQL StrSQL = " SELECT NOM FROM ATTRIBUT WHERE LIBELLE = TRUC" Dim rcdSet rcdSet = Server.CreateObject("ADODB.Recordset") rcdSet.Open StrSQL, objConn , adOpenForwardOnly, adLockPessimistic |
|
#2
|
|||
|
|||
|
Throw single quotes around truce
it is a string>> if it was an int, you would not have to worry about it should get it |
|
#3
|
|||
|
|||
|
Yes it is true that I have to put single quotes around TRUC. But the problem is still the same.
Thanks for help even though |
|
#4
|
|||
|
|||
|
const strMySQL_Conn = _
"PROVIDER=SQLOLEDB.1;DATA SOURCE=dataserverA;uid=Tax Admin;pwd= FakePass;Initial Catalog=Tax System;" call this sub everytime you want to use the db sub OpenTaxConnMain set connMain = Server.CreateObject("ADODB.Connection") connMain.ConnectionString = strMySQL_Conn connMain.Open end sub then when you define a qry say: strsql = "select count(*) as count from tax_fields where acctNUM = 223 and ExpandedOrder_Parcel <> 0 set rsmain = connMain.Execute(strSQL, , adCmdText) What else |
|
#5
|
|||
|
|||
|
I have tried your solution
But I obtain a syntax error on 'Sub OpenTaxConnMain' It's a bit strange. Just a question about the line : const strMySQL_Conn = _ "PROVIDER=SQLOLEDB.1;DATA SOURCE=dataserverA;uid=Tax Admin;pwd= FakePass;Initial Catalog=Tax System;" Your data source is the name of your DB? Or the ODBC link? |
|
#6
|
|||
|
|||
|
const strMysql_Conn = _
"PROVIDER=SQLOLEDB.1;DATA SOURCE=dataserverA;uid=Tax Admin;pwd= FakePass;Initial Catalog=Tax System;" data source is the name of my database server (microsoft sql server) here is the connection for access---That is what you are using right? Private Const strAccess_Conn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Jet OLEDB:Engine Type=5;Data Source=C:\DatabaseName.mdb" when opening your db just call the sub OpenTaxConnMain to connect then run any sql you want with set rsmain = connMain.Execute(strSQL, , adCmdText) after the qry email back if anything else |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Execution of SQL Request : problem of Recordset |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|