Ask a Question related to ASP Database, Design and Development.
-
Dan #1
newbie, ado issue
i set up IIS and made a test asp script, that worked.
I am trying to get some database connectivity, but I'm just not getting it.
I copied to code straight from MS's Help file. (and made a few changes)
for some reason i keep getting the following error:
HTTP 500.100
Error Type:
ADODB.Recordset (0x800A0E7D)
The connection cannot be used to perform this operation. It is either
closed or invalid in this context.
/Testproject1/Default.asp, line 21
here is the code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<P>test</P>
<%
'Establish a connection with data source.
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\test.mdb"
Set cnn = Server.CreateObject("ADODB.Connection")
'Instantiate a Recordset object.
Set rstListing = Server.CreateObject("ADODB.Recordset")
'Open a recordset using the Open method
'and use the connection established by the Connection object.
strSQL = "SELECT fname, lname FROM book;"
rstListing.Open strSQL, cnn
'Cycle through record set and display the results
'and increment record position with MoveNext method.
Set objfname = rstListing("fname")
Set objlname = rstListing("lname")
Do Until rstListing.EOF
Response.Write objfname & " " & objlnameame & "<BR>"
rstListing.MoveNext
Loop
%>
</BODY>
</HTML>
Dan Guest
-
Newbie Javascript issue
I have a situation where rather than send an ID variable across as a url I'm trying to send it over as a form variable. (I know - that is probably... -
Actionscript newbie: simple stop issue
Hello everyone. I'm trying to get a nested movie to stop playing when a 'stop' button is clicked. This movie is nested within two other movies,... -
Newbie ASP script issue
Hi all, I have a problem with my ASP script below and the error message is: "The maximum amount of time for a script to execute was exceeded. ... -
Newbie Hello World Authentication Issue
Hi... Real dumb question here, I'm sure: Setting up my first Hello World ASP.Net app...I can get it to run from the server machine that I am... -
Newbie Monitor Issue
RedHat 9, ATI Radeon 7000 PCI, Shamrock 19" VESA monitor. Installation went very smooth. However, monitor goes black when loading firstboot. In... -
Maarten #2
Re: newbie, ado issue
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & server.MapPath("test.mdb")
Set cnn = Server.CreateObject("ADODB.Connection")
Maarten Guest
-
d0x #3
Re: newbie, ado issue
On Fri, 16 Jul 2004 08:58:30 +0000, Maarten wrote:
> strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> server.MapPath("test.mdb")
> Set cnn = Server.CreateObject("ADODB.Connection")
Gave that a try..
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
server.MapPath("/TestProject1/test.mdb")
i aslo tried just "test.mdb" , "/test.mdb"
same thing
d0x Guest
-
Bob Barrows [MVP] #4
Re: newbie, ado issue
Dan wrote:
You have to open the connection first ...> <%
> 'Establish a connection with data source.
> strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Inetpub\wwwroot\test.mdb"
> Set cnn = Server.CreateObject("ADODB.Connection")
>
>
> 'Instantiate a Recordset object.
> Set rstListing = Server.CreateObject("ADODB.Recordset")
>
> 'Open a recordset using the Open method
> 'and use the connection established by the Connection object.
cnn.open strConnectionString
Bob Barrows> strSQL = "SELECT fname, lname FROM book;"
> rstListing.Open strSQL, cnn
>
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] Guest
-
Dan #5
Re: newbie, ado issue
Bob Barrows [MVP] wrote:
> Dan wrote:
>
>>>><%
>> 'Establish a connection with data source.
>> strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
>>Source=C:\Inetpub\wwwroot\test.mdb"
>> Set cnn = Server.CreateObject("ADODB.Connection")
>>
>>
>> 'Instantiate a Recordset object.
>> Set rstListing = Server.CreateObject("ADODB.Recordset")
>>
>> 'Open a recordset using the Open method
>> 'and use the connection established by the Connection object.
>
> You have to open the connection first ...
>
>
> cnn.open strConnectionString
>
>
>>>> strSQL = "SELECT fname, lname FROM book;"
>> rstListing.Open strSQL, cnn
>>
>
> Bob Barrows
ah hah!
who would think that one must open the door before he walks into the room...
That did the trick, Thanks a bunch!!!
Dan Guest



Reply With Quote

