Cannot link ASP page to Access database
am 22.02.2005 16:35:02 von andrewdreib
I'm new to this and am having a lot of trouble. I've been able to work my way
through a couple of other bugs that have come up, but I just don't understand
this one. I'm trying to run a very simple, small database for a project for a
class. I've created my own web server on an XP Pro machine that is running
IIS 5.1, I also just upgraded it to Jet 4.0. This error is obviously a server
error, but I don't know what to do to fix it.
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 0x278 Thread 0x8b0 DBC
0x1055bbc Jet'.
/input.asp, line 25
And here's the ASP code for the page I'm trying to run.
<% @Language=VBScript %>
Input Information
<%
IF request.form ("input")="True" THEN
strF1=request.form("FName")
strF2=request.form("LName")
strF3=request.form("Age")
strF4=request.form("Birthdate")
strF5=request.form("Sex")
strF6=request.form("HColor")
strF7=request.form("EColor")
strF8=request.form("Hometown")
strF9=request.form("FavColor")
strF10=request.form("Email")
'Connects to the Access driver and Access database in the Inetpub
'directory where the database is saved
strProvider = "Driver={Microsoft Access Driver (*.mdb)};
DBQ=C:\Inetpub\wwwroot\numbers.mdb;"
'Creates an instance of an Active Server component
set objConn = server.createobject("ADODB.Connection")
'Opens the connection to the data store
objConn.Open strProvider
'Instantiate Command object and use ActiveConnection property to
'attach connection to Command object
set cm = Server.CreateObject("ADODB.Command")
cm.ActiveConnection = objConn
'Define SQL query
cm.CommandText ="INSERT INTO numbers (F1,F2,F3,F4,F5,F6,F7,F8,F9,F10) VALUES
(?,?,?,?,?,?,?,?,?,?)"
'Define query parameter configuration information for database fields
set objparam=cm.createparameter(, 200, , 50, strF1)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 50, strF2)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 255, strF3)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 255, strF4)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 6, strF5)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 10, strF6)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 10, strF7)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 50, strF8)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 10, strF9)
cm.parameters.append objparam
set objparam=cm.createparameter(, 200, , 50, strF10)
cm.parameters.append objparam
cm.execute
response.write("Thank you!")
ELSE%>
Input Information
<%End if%>
I know about the line breaks, they only happened when I pasted in here.
Re: Cannot link ASP page to Access database
am 22.02.2005 16:49:20 von Steven Burn
http://aspfaq.com/show.asp?id=3D2009
http://aspfaq.com/show.asp?id=3D2413
--=20
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"andrewdreib" wrote in message =
news:6D7BF19B-D158-4D2B-8FF3-152C1C1795C1@microsoft.com...
> I'm new to this and am having a lot of trouble. I've been able to work =
my way=20
> through a couple of other bugs that have come up, but I just don't =
understand=20
> this one. I'm trying to run a very simple, small database for a =
project for a=20
> class. I've created my own web server on an XP Pro machine that is =
running=20
> IIS 5.1, I also just upgraded it to Jet 4.0. This error is obviously a =
server=20
> error, but I don't know what to do to fix it.=20
>=20
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC Microsoft Access Driver]General error Unable to open=20
> registry key 'Temporary (volatile) Jet DSN for process 0x278 Thread =
0x8b0 DBC=20
> 0x1055bbc Jet'.
> /input.asp, line 25
>=20
> And here's the ASP code for the page I'm trying to run.
>=20
> <% @Language=3DVBScript %>
>
>
> Input Information
>
>
background=3D"spaced%201%20and%200.JPG">
> <%
> IF request.form ("input")=3D"True" THEN
> strF1=3Drequest.form("FName")
> strF2=3Drequest.form("LName")
> strF3=3Drequest.form("Age")
> strF4=3Drequest.form("Birthdate")
> strF5=3Drequest.form("Sex")
> strF6=3Drequest.form("HColor")
> strF7=3Drequest.form("EColor")
> strF8=3Drequest.form("Hometown")
> strF9=3Drequest.form("FavColor")
> strF10=3Drequest.form("Email")
> 'Connects to the Access driver and Access database in the Inetpub
> 'directory where the database is saved
> strProvider =3D "Driver=3D{Microsoft Access Driver (*.mdb)};=20
> DBQ=3DC:\Inetpub\wwwroot\numbers.mdb;"
> 'Creates an instance of an Active Server component
> set objConn =3D server.createobject("ADODB.Connection")
> 'Opens the connection to the data store
> objConn.Open strProvider
> 'Instantiate Command object and use ActiveConnection property to
> 'attach connection to Command object
> set cm =3D Server.CreateObject("ADODB.Command")
> cm.ActiveConnection =3D objConn
> 'Define SQL query
> cm.CommandText =3D"INSERT INTO numbers =
(F1,F2,F3,F4,F5,F6,F7,F8,F9,F10) VALUES=20
> (?,?,?,?,?,?,?,?,?,?)"
> 'Define query parameter configuration information for database fields
> set objparam=3Dcm.createparameter(, 200, , 50, strF1)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 50, strF2)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 255, strF3)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 255, strF4)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 6, strF5)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 10, strF6)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 10, strF7)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 50, strF8)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 10, strF9)
> cm.parameters.append objparam
> set objparam=3Dcm.createparameter(, 200, , 50, strF10)
> cm.parameters.append objparam
> cm.execute
> response.write("Thank you!")
> ELSE%>
>
Input Information
>
> <%End if%>
>
>
>=20
> I know about the line breaks, they only happened when I pasted in =
here.
Re: Cannot link ASP page to Access database
am 22.02.2005 17:03:54 von reb01501
andrewdreib wrote:
> I'm new to this and am having a lot of trouble. I've been able to
> work my way through a couple of other bugs that have come up, but I
> just don't understand this one. I'm trying to run a very simple,
> small database for a project for a class. I've created my own web
> server on an XP Pro machine that is running IIS 5.1, I also just
> upgraded it to Jet 4.0. This error is obviously a server error, but I
> don't know what to do to fix it.
>
> 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 0x278 Thread
> 0x8b0 DBC 0x1055bbc Jet'.
> /input.asp, line 25
This error is a suggestion that you stop using ODBC. You can make registry
changes to make it work, but it is much easier to simply switch to the Jet
OLE DB provider:
>
> 'Connects to the Access driver and Access database in the Inetpub
> 'directory where the database is saved
> strProvider = "Driver={Microsoft Access Driver (*.mdb)};
> DBQ=C:\Inetpub\wwwroot\numbers.mdb;"
strProvider="Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Inetpub\wwwroot\numbers.mdb;"
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.
Re: Cannot link ASP page to Access database
am 22.02.2005 19:11:04 von andrewdreib
I almost have it working. I'm using the Jet OLEDB and it's kind of working
now, it just won't execute.
The error is:
Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/input.asp, line 54
Is there something I missed in Access to set this up?
Thanks so much for your help.
~Andrew
"Bob Barrows [MVP]" wrote:
> andrewdreib wrote:
> > I'm new to this and am having a lot of trouble. I've been able to
> > work my way through a couple of other bugs that have come up, but I
> > just don't understand this one. I'm trying to run a very simple,
> > small database for a project for a class. I've created my own web
> > server on an XP Pro machine that is running IIS 5.1, I also just
> > upgraded it to Jet 4.0. This error is obviously a server error, but I
> > don't know what to do to fix it.
> >
> > 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 0x278 Thread
> > 0x8b0 DBC 0x1055bbc Jet'.
> > /input.asp, line 25
>
> This error is a suggestion that you stop using ODBC. You can make registry
> changes to make it work, but it is much easier to simply switch to the Jet
> OLE DB provider:
>
> >
>
> > 'Connects to the Access driver and Access database in the Inetpub
> > 'directory where the database is saved
> > strProvider = "Driver={Microsoft Access Driver (*.mdb)};
> > DBQ=C:\Inetpub\wwwroot\numbers.mdb;"
>
> strProvider="Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=C:\Inetpub\wwwroot\numbers.mdb;"
>
> 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.
>
>
>
Re: Cannot link ASP page to Access database
am 22.02.2005 19:28:15 von reb01501
Permissions - probably for the IUSR acount which needs Change permissions
for the folder containing your database:
http://www.aspfaq.com/show.asp?id=2062
http://www.aspfaq.com/show.asp?id=2009
Bob Barrows
andrewdreib wrote:
> I almost have it working. I'm using the Jet OLEDB and it's kind of
> working now, it just won't execute.
>
> The error is:
>
> Error Type:
> Microsoft JET Database Engine (0x80004005)
> Operation must use an updateable query.
> /input.asp, line 54
>
> Is there something I missed in Access to set this up?
>
> Thanks so much for your help.
>
> ~Andrew
>
> "Bob Barrows [MVP]" wrote:
>
>> andrewdreib wrote:
>>> I'm new to this and am having a lot of trouble. I've been able to
>>> work my way through a couple of other bugs that have come up, but I
>>> just don't understand this one. I'm trying to run a very simple,
>>> small database for a project for a class. I've created my own web
>>> server on an XP Pro machine that is running IIS 5.1, I also just
>>> upgraded it to Jet 4.0. This error is obviously a server error, but
>>> I don't know what to do to fix it.
>>>
>>> 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 0x278
>>> Thread 0x8b0 DBC 0x1055bbc Jet'.
>>> /input.asp, line 25
>>
>> This error is a suggestion that you stop using ODBC. You can make
>> registry changes to make it work, but it is much easier to simply
>> switch to the Jet OLE DB provider:
>>
>>>
>>
>>> 'Connects to the Access driver and Access database in the Inetpub
>>> 'directory where the database is saved
>>> strProvider = "Driver={Microsoft Access Driver (*.mdb)};
>>> DBQ=C:\Inetpub\wwwroot\numbers.mdb;"
>>
>> strProvider="Microsoft.Jet.OLEDB.4.0;" & _
>> "Data Source=C:\Inetpub\wwwroot\numbers.mdb;"
>>
>> 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.
--
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.
Create a random query with ASP
am 23.02.2005 18:29:08 von andrewdreib
Thank you I have it up and running now.
Now I'm on to my next challenge, I'm trying to create an ASP page that will
randomly query the database and show entire entires. I found some code online
that prints on entry from the table, but only one piece of information from
it, and I'm hoping someone here know what I need to change to make it print
the entire entry.
Here's what I have:
============================================================ ================
<%
Option Explicit
Response.Buffer = True
%>
<%
' ADO Constant. Dont change this
Const adCmdText = &H0001
' Connection string and SQL statement
Dim query, connStr
query = "select ID from numbers"
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Inetpub\wwwroot\numbers.mdb"
' Opening database
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open query, connStr, 3, , adCmdText
' Generating random number from total number of records
Dim intRnd
Randomize Timer
intRnd = (Int(RND * rs.RecordCount))
' Now moving the cursor to random record number
rs.Move intRnd
' Showing the random statement
Response.Write "" & rs("statement") & ""
' Closing the database
rs.Close
Set rs = Nothing
%>
============================================================ ==============
The fields in my table are ID, and F1-F10. I'll try to figure this out
myself, but help is definately appreciated.