Print Page | Close Window

adding to a database

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=18449
Printed Date: 29 March 2026 at 10:54pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: adding to a database
Posted By: rbyikes
Subject: adding to a database
Date 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????



Replies:
Posted By: site master
Date 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)};"



-------------


Posted By: rbyikes
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net