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

recordset error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
what is wrong with this code?

dim seepage
if request.querystring(&quot;seepage&quot;) = &quot;&quot; OR request.querystring(&quot;seepage&quot;) < 1 then
seepage = 1
else
seepage = request.querystring(&quot;seepage&quot;)
end if

id = Request.QueryString(&quot;msgID&quot;)
Set connectionToDatabase=Server.CreateObject(&quot;ADODB.Connection&quot;)
Set rs=Server.CreateObject(&quot;ADODB.Recordset&quot;)
connectionToDatabase.Open &quot;DSN=dtDB;UID=scott;PWD=tiger&quot;

Set rsadd = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsadd.Open &quot;SELECT * FROM MsgBoard WHERE msgID=&quot; & id, connectionToDatabase,1,2
rsadd(&quot;threadID&quot;) = rsadd(&quot;msgID&quot;)
rsadd.Update
%>

I am getting an error that:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC driver does not support the requested properties.
This errror is on this line:
rsadd.Open &quot;SELECT * FROM MsgBoard WHERE msgID=&quot; & id, connectionToDatabase,1,2

thanks in advance
 
This is how i do it...


vSql=&quot;SELECT MsgBoard.* FROM MsgBoard WHERE (((MsgBoard.msgID)='&quot; & id & &quot;'));&quot;
rsadd.open vSql,connectionToDatabase,1,2,1

Since i don't know anything about your database, you might have to change a few things. It's a bit dif then your code, try it this way...

Hope it'll help ;-)


Have Fun...

Sharky99 >:):O>
 
thanks SHARKY99!
I have already tried this but I think there is more to the error than that.
Hopefully, someone may have come across this problem before.
 
It appears you are going through an ODBC layer, which is an added layer and unnecessary with ADO since the ADO libraries are built into the Windows 2000 OS or can be installed free on a WinXX PC. The ODBC layer may have restrictions that would not be in a direct ADO connection.

Build the connection string without ODBC. A simple way to build and test the connection string is to create an empty notepad file on the server desktop. Change the extention on the notepad file to whatever.udl, then double click on the udl file. It will bring up a pop up with tabs to build the string. Save the file and then go into notepad and open the file, and you will see the connection string which you can cut and paste into your program.
 
what is .udl?
do you have an example syntax that i can use?
thanks in advance.
 
udl is a user defined link or a way microsoft walks you through building the connection string. Sometimes the syntax is difficult to get correct, but letting the program build it for you solves this problem. It works like a wizard. Did you try what I suggested?

 
Example of connection string in an include file to an SQL Server database.
<%

Dim strCnn
dim loginName
dim loginPassword

' &quot;Login string to access the database;&quot;
' --------------------------------------------------------
strCnn = &quot;Provider=SQLOLEDB;&quot; & _
&quot;Data Source=BigTuna;Database=AlarisBETA1;&quot; & _
'---- will need to append login name and password
&quot;User Id=sa;Password=;&quot;
%>
This connection string is used in the open in another ASP page.

Another example to an Access MDB.
<!-- METADATA TYPE=&quot;typelib&quot;
FILE=&quot;C:\Program Files\Common Files\System\ado\msado15.dll&quot; -->
<%
Dim objConn
Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0; &quot; & _
&quot;User ID=Admin;password=; &quot; & _
&quot;Data Source= C:\databases\MotorRepairLogins.mdb; &quot; & _
&quot;Persist Security Info=False&quot;
%>

example of using connection string in ADO call.
' Open the recordset.
objRst.Open Sql, objConn, adOpenStatic, adLockReadOnly

 
thanks a bunch cmmrfrds!
This is exactly what I need to convert to oracle.
Dim objConn
Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0; &quot; & _
&quot;User ID=Admin;password=; &quot; & _
&quot;Data Source= C:\databases\MotorRepairLogins.mdb; &quot; & _
&quot;Persist Security Info=False&quot;
%>
can you convert this to oracle.
I am sorry I am new to oracle.
I was using the above connection method but I could not convert it to oracle.
 
When you open the .udl file, then Oracle is one of the providers. Just select oracle as the provider, supply your server and database, and it will build the connection string for you. As previously mentioned, then just copy and paste into your program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top