Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - adding to a database
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

adding to a database

 Post Reply Post Reply
Author
rbyikes View Drop Down
Newbie
Newbie


Joined: 01 February 2006
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote rbyikes Quote  Post ReplyReply Direct Link To This Post Topic: adding to a database
    Posted: 20 February 2006 at 5:18am
Trying to ad a new line to a database
 
I have yet to have success opening the db and updating the file from an asp script
 
My error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
/manageprofile.asp, line 73
 
My script

' open the database connection

set con = server.createobject( "adodb.connection" )

con.open "accessdsn"   <<<<<<<This is my line 73

%>

<html>

<head><title>Manage Profile</title></head>

<body bgcolor="gray">

' add new profiledb

if addprofile <> "" then

sqlstring = "insert into profiledb " &_

"( screenname, password, emailaddress, first, mi, last, age, city, state, areacode, lookingfor, heading, briefdescription, fulldescription, picture ) " &_

values ( " & fixquotes( screenname ) & fixquotes( password ) & fixquotes( emailaddress ) & fixquotes( first ) & fixquotes( mi ) & fixquotes( last ) & fixquotes( age ) & fixquotes( city ) & fixquotes( state ) & fixquotes( areacode) & fixquotes( lookingfor ) & fixquotes( breifdescrtiption ) & fixquotes( fulldescription ) & fixquotes( picture ) & " )

con.execute sqlstring

 

My dsn name is "accessdsn"

and the root directory points to the correct file
what am I missing????


Edited by rbyikes - 20 February 2006 at 5:19am
Back to Top
site master View Drop Down
Newbie
Newbie


Joined: 08 January 2006
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote site master Quote  Post ReplyReply Direct Link To This Post Posted: 20 February 2006 at 11:01am
why do you use DSN?
its much more easy to use ADO

set con=server.createobject("adodb.connection")
con.open "DBQ=" & Server.Mappath("database location") & ";Driver={Microsoft Access Driver (*.mdb)};"



Edited by site master - 20 February 2006 at 11:04am
Back to Top
rbyikes View Drop Down
Newbie
Newbie


Joined: 01 February 2006
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote rbyikes Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2006 at 6:38am
the book I have says to used dsn, I don't care what I use, I just want a stable conection to the database. I am quite new to .asp and would ask if you might do me a favor, and change the color of the words that are specific to my database connection.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.