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 4th, 2005, 09:34 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default Insert into db error

Hi,
I have the following code which connects to access database

It is very interesting when I user server.mappath I get no error
but when I use the pgysical path to the db like this
Conn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\mydb.mdb") & ";"
I get insert into sql statement error
and when I try to update with sql statement I get the same error
How is that??


set Conn=server.createobject("Adodb.connection")
Conn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\myDB.mdb") & ";"
Conn.open

sql = "INSERT INTO cards (catID,subID,type,thumbnail,image,name,keyword,act ive,free)"
sql= sql & " VALUES ('"
sql=sql & intCategory & "', '"
sql=sql & "0" & "', '"
sql=sql & strCardType & "', '"
sql=sql & strThumb & "', '"
sql=sql & strImage & "', '"
sql=sql & strCardName & "', '"
sql=sql & strKeyword & "', '"
sql=sql & blnFree & "', '"
sql=sql & blnActive & "');"
conn.execute(SQL)

 
Old December 5th, 2005, 07:30 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Have you checked the permissions your IUSR account has on the .mdb file - it looks like they may be read-only?

HTH,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Issue into Acces DB brawny4 Visual Basic 2005 Basics 2 February 21st, 2007 08:43 PM
Insert Variable Value into DB Deano252 ASP.NET 2.0 Basics 1 June 24th, 2006 03:21 AM
insert into db keyvanjan Classic ASP Databases 1 May 9th, 2005 11:50 PM
can't insert in db darkhalf Classic ASP Databases 11 January 12th, 2005 06:48 AM
Unable to INSERT INTO db nvillare Classic ASP Databases 6 August 26th, 2003 10:29 AM





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