Ask a Question related to ASP Database, Design and Development.
-
Wayne... #1
newbie: error ...HHHEEELLLPPP!!!!
ok I'm VERY new to ASP and have managed to get a page up and running that
reads from a database...I can even get it to delete a row...... BUT...
whenever I try the add page I get the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open
registry key 'Temporary (volatile) Jet DSN for process 0x30c Thread 0x7c8
DBC 0x26f8e74 Jet'.
/people/gotodb.asp, line 6
(I have checked this and it seems fine....)
I was following an example on a webpage but it doesn't cover this....
the db is an acccess one, I am trying to write to 2 of the fields out of the
4 that exist in the table.
I am sure that my conection is wrong but b4 my format and reinstall last
night everything was working 'semi' fine.
Wayne..
PS sorry for the very messy code :(
original code:
<%@ Language=VBScript %>
<%
'Store the variable to name. txtnameadd is the text box in index.htm
'If you study the HTML code of it you will understand
'Request.form function request the value from the form.
name = server.HtmlEncode(request.form("txtnameadd"))
About = server.HtmlEncode(request.form("txtnameadd"))
'Create object. In this case Connection to a database
Set Conn = Server.CreateObject("ADODB.Connection")
'Select provider
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
'Select data source.
'Server.MapPath function is equivalent to app.path function of VB
'It returns the directory in which the script is present
Conn.ConnectionString = "Data Source=" & Server.MapPath ("people.mdb")
'Open the connection
Conn.Open
'Create recordset
Set Rs = Server.CreateObject("ADODB.Recordset")
'Open recordset with the connection which we have created earlier
'you must be familiar with SELECT statement ,
'If not check my VB tutorial section.
Rs.Open "SELECT * from people", Conn, 1,3
'Add a blank record
Rs.addnew
'Store name to
Rs("name") = name
Rs("About") = About
Rs.update
'Deinitialize the Connection and Recordset
set Rs = nothing
set Conn = nothing
%>
<p>User Successfully added</p>
<p><a href="people2.asp">Return to Index</a></p>
current code:
<%@ Language=VBScript %>
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsAddComments 'Holds the recordset for the new record to be added
Dim strSQL 'Holds the SQL query to query the database
'Store the variable to name. txtnameadd is the text box in index.htm
'If you study the HTML code of it you will understand
'Request.form function request the value from the form.
name = server.HtmlEncode(request.form("txtnameadd"))
About = server.HtmlEncode(request.form("About"))
'Create object. In this case Connection to a database
'Set Conn = Server.CreateObject("ADODB.Connection")
Set adoCon = Server.CreateObject("ADODB.Connection")
'Select provider
'Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
'Select data source.
'Server.MapPath function is equivalent to app.path function of VB
'It returns the directory in which the script is present
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("people.mdb")
'Conn.ConnectionString = "Data Source=" & Server.MapPath ("people.mdb")
'Open the connection
'Conn.Open
'Set an active connection to the Connection object using DSN connection
adoCon.Open "DSN=guestbook"
'Create an ADO recordset object
Set rsAddComments = Server.CreateObject("ADODB.Recordset")
'Create recordset
'Set Rs = Server.CreateObject("ADODB.Recordset")
'Open recordset with the connection which we have created earlier
'you must be familiar with SELECT statement ,
'If not check my VB tutorial section.
'Rs.Open "SELECT * from people", Conn, 1,3
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM people;"
'Set the cursor type we are using so we can navigate through the recordset
rsAddComments.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsAddComments.LockType = 3
'Open the recordset with the SQL query
rsAddComments.Open strSQL, adoCon
'Tell the recordset we are adding a new record to it
rsAddComments.AddNew
'Add a new record to the recordset
rsAddComments.Fields("Name") = Request.Form("name")
rsAddComments.Fields("About") = Request.Form("About")
'Write the updated recordset to the database
rsAddComments.Update
'Reset server objects
rsAddComments.Close
Set rsAddComments = Nothing
Set adoCon = Nothing
'Redirect to the guestbook.asp page
Response.Redirect "people2.asp"
%>
Wayne... Guest
-
FMS3 Newbie - Error help
Fresh install of FMS3 (paid version). Other than the setup settings, I haven't modified anything. I have a commercial chat/video product that the... -
mysql error [newbie]
I just installed mysql and ran the upgrade for fedora 4 but i get this error # mysql ERROR 2002 (HY000): Can't connect to local MySQL server... -
Newbie - Directive causes syntax error
I am studying a Wrox book, "Beginning ASP.NET 1.1 with VB.NET". In the chapter on Web Services I am trying an example in VS 2003 with VB.NET that... -
Error 500 newbie question
Hi all, I'm running Win2k Pro with IIS on it, at home. My ISP doesn't allow me to publish to port 80, so I'm publishing on 2850. My HTML runs... -
Please help with this error - newbie
Hi there, I just started a small application with a list with one table, and hyperlink to retrieve and display detail data. Also create a XST,... -
Bob Barrows #2
Re: newbie: error ...HHHEEELLLPPP!!!!
Wayne... wrote:
[url]http://www.aspfaq.com/show.asp?id=2154[/url]> ok I'm VERY new to ASP and have managed to get a page up and running
> that reads from a database...I can even get it to delete a row......
> BUT... whenever I try the add page I get the following error:
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
> registry key 'Temporary (volatile) Jet DSN for process 0x30c Thread
> 0x7c8 DBC 0x26f8e74 Jet'.
> /people/gotodb.asp, line 6
> (I have checked this and it seems fine....)
[url]http://www.aspfaq.com/show.asp?id=2009[/url]
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows Guest



Reply With Quote

