Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 15th, 2004, 02:14 PM
Authorized User
 
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default trying to retrieve data from another page

I am getting this error. Help me understand what am I doing wrong.
Microsoft VBScript runtime error '800a01c2'

Wrong number of arguments or invalid property assignment: 'Open'

/forms/Results.asp, line 43

Line:43 is:

ObjConn.Open "Escalation_Forms", ObjConn, , adLockOptimistic, adCmdTable

The rest of the code:

Dim TicketNum, rs, ObjConn, Conn, strSQL, adLockOptimistic, adCmdTable


TicketNum = Request.QueryString("Ticket_Number")

set objConn=Server.CreateObject("ADODB.CONNECTION")

ObjConn.Open "Provider=sqloledb;Data Source=Flmirsql02;Initial Catalog=Source_Forms;User Id=Source_Forms_User;Password=password;"

ObjConn.Open "Ticket_Number", ObjConn, , adLockOptimistic, adCmdTable

Set rs = Server.CreateObject("ADODB.Recordset")

Set rs = Conn.Execute("SELECT First_Name FROM Escalation_Forms WHERE Ticket_Number = " & TicketNum)

if rs.eof then
   Response.write("No data was returned for ticket number: " & TicketNum)
else
   First_Name = rs("First_Name")
end if

ObjConn.Close
Set ObjConn = Nothing
%>
<table>
   <tr>
      <td>First Name:</td><td><input type="text" name="firstName" value="<%=First_Name%>">
   </tr>
</table>


 
Old July 15th, 2004, 03:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Do you have these assigned to the correct value: adLockOptimistic, adCmdTable? They have to be assigned to their equivalent value. You can get them from the adovbs.inc whenever you create a new web site using Interdev.

Brian
 
Old July 15th, 2004, 09:53 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi calibus,

   You include the file adovbs.inc file using

this file has all constants for ADO



 
Old July 17th, 2004, 11:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Calibus,
Code:
set objConn=Server.CreateObject("ADODB.CONNECTION")
...
ObjConn.Open "Ticket_Number", ObjConn,  , adLockOptimistic, adCmdTable
You cannot use CONNECTION object to do this. Also Open method of CONNECTION object doesn't take these sort of parameters. You can check out for its parameters.

Just comment this line, you should get things working.;)
''''ObjConn.Open "Ticket_Number", ObjConn, , adLockOptimistic, adCmdTable

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve Data from Java Bean to JSP page Nirav Joshi JSP Basics 1 August 24th, 2005 07:45 AM
How to retrieve a web page from access database method Access ASP 1 May 2nd, 2005 06:29 PM
Retrieve data page by page riswan BOOK: Professional Crystal Reports for VS.NET 0 April 27th, 2005 10:41 PM
Retrieve data Snib C++ Programming 2 November 6th, 2004 11:09 AM
data retrieve from three tables mateenmohd SQL Server 2000 2 October 7th, 2003 04:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.