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 December 23rd, 2003, 08:23 AM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to J1NK5
Default Addnew using DSN & Access

Hello,

I am trying to write a holding page that will track who has open the site. The table is access and is called "tracking". I have a system DSN setup that I have used to query another table so I believe that is working Fine.

The code at present looks like this:

<%
Dim StrConn, objConn, objRS, strSQL
strConn="DSN=FranticStar"
set objConn = server.CreateObject("ADODB.Connection")
objConn.Open strConn
set objRS = server.CreateObject("ADODB.recordset")
objRS.Open "tracking",objConn
objRS.AddNew
objRS.Fields("Time") = "#" & now & "#"
objRS.Fields("ip") = "'" & request.servervariables("remote_addr") & "'"
objRS.Fields("user") = "'" & Request.ServerVariables("LOGON_USER") & "'"
objRS.Update
objRS.Close
set objRS=nothing
objConn.Close
set objConn=nothing
%>
<P align=center>&nbsp;</P>
<P align=center>&nbsp;</P>
<P align=center><IMG src="images/FranticStar.jpg" width="353" height="50"
></P>
<P align=center>Cooming Soon</P>

</BODY>
</HTML>

However I get :The page cannot be displayed message! :(

Can anyone help?

www.franticstar.co.uk
 
Old December 23rd, 2003, 12:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may need to enable more detailed error messages in either your browser, or at the server (or both). For the browser (IE), open the Options panel, switch to the Advanced tab and disable Show friendly HTTP error messages. For IIS, open your site, click the Configuration button on either the Directory or Home Directory tab, and then switch to the Debugging tab. Make sure that Send detailed ASP error messages to client is checked.

Once you have done that, rerun the page and a detailed error message will appear. Post that message to this list, so we can take a look at it.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 23rd, 2003, 12:54 PM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to J1NK5
Default

OK now I get:

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/Test/test.asp, line 14


www.franticstar.co.uk
 
Old December 23rd, 2003, 04:45 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right. That's at least easier to work with.

I think this error is caused by the fact that your current recordset does not support AddNew. Take a look at this site for possible solutions. Especially step 3 is worth looking at.

To fix this, pass in the right parameters to the Open method. To see what you need to pass, take a look here: http://msdn.microsoft.com/library/de...mdamth03_2.asp

To pass in the right constants for LockType and CursorType, make sure your calling code can see them correctly. For hints on how to do this, look here: http://www.adopenstatic.com/faq/800a0bb9step2.asp

If possible, go with recommendation number 1.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DSN To Connect Access Dabase hunzian78@yahoo.com ASP.NET 1.0 and 1.1 Basics 0 March 22nd, 2006 07:26 AM
about changing dsn & server.mappath liniyer_667 Classic ASP Databases 0 June 12th, 2005 11:18 AM
Need DSN Connection Code to Access DB markw707 ASP.NET 1.0 and 1.1 Basics 0 May 13th, 2005 09:10 AM
Application DSN and Session DSN ssampanthar Classic ASP Databases 0 January 6th, 2005 01:23 PM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM





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