Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 2nd, 2004, 02:25 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 12 - movie example

Greetings boarders, this is my first post.

Anyhow, I am trying to get the moviebase example in Chapter 12 to work, to no avail.

I installed MSDE 2000A, which I downloaded free from MS. Then I placed the MovieMSDE.mdf in the correct loaction, which for me is, D:\MSDE2000A\DATA\MSSQL\Data.

I had recieved an error when I type the code myself and tried to open the 'connection.asp page', so I downloaded the code from Wrox and am still getting the same "ADODB.Connection.1 error '800a0bb9' " error.

The instructions for installation from the book mentioned installing it (MSDE) from Office 2000 and Visual Studio - - neither method required a password; the downloaded version did.

Here is the current code, the same as the Wrox from the book :

<%Option Explicit%>
<HTML>
<HEAD>
<TITLE>Testing our connection</TITLE>
</HEAD>
<BODY>

<%
Dim adOpenForwardOnly, adLockReadOnly, adCmdTable
adOpenForwardOnly = 0
adLockReadOnly = 1
adCmdTable = 2

Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")

Dim strDatabaseType
'Choose one of the following two lines, and comment out the other
'strDatabaseType = "Access"
strDatabaseType = "MSDE"

'Now we use this selection to open the connection in the appropriate way
If strDatabaseType = "Access" Then
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data Source=C:\datastores\Movie2000.mdb;" & _
               "Persist Security Info=False"
Else
  objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _
      "User Id=sa; Initial Catalog=Movie;" & _
      "Initial File Name=D:\MSDE2000A\DATA\MSSQL\Data\MovieMSDE.mdf"

End If

objRS.Open "Movies", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable

While Not objRS.EOF
  Response.Write objRS("Title") & "<BR>"
  objRS.MoveNext
Wend

objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>

</BODY>
</HTML>
----
I am assuming i need that password set in the connection string, but the book only gives the example of :

"Provider= SQLOLEDB; Data Source=MyDataMachine;" & _
"Database=Movie;User ID=sa; Password="

I can't this to work even if I substiture my password - - am I supposed to change the 'MyDataMachine' line??

thanks in advance!
patrick
newbie

  #2 (permalink)  
Old June 2nd, 2004, 02:27 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

p.s. -

the description with the error is :

ADODB.Connection.1 error '800a0bb9'

The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.

/asp/Connect-01.asp, line 29

Thanks!

  #3 (permalink)  
Old June 3rd, 2004, 05:56 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've searched around, and read tons of different articles and tips, but none the pertain specifically enough to my problem to figure this out. I don't have MS ACCESS either, so I can't take the book's advice and use that instead of MSDE 2000... anyone out there with any pointers?



  #4 (permalink)  
Old June 4th, 2004, 01:37 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Patrick,

How did you install the MSDE? Did you give it a name / instancename?

To find out, look here: C:\Program Files\Microsoft SQL Server
Is there a folder with a $ in it? The part after the $ is your instance name. In your connection string, you should then use MachineName\InstanceName instead of just MachineName

"Provider= SQLOLEDB; Data Source=MachineName\InstanceName;" & _
"Database=Movie;User ID=sa; Password="

where MachineName is the name of the machine running MSDE.

Also, the first connectionstring for MSDE doesn't look good. You can't use the Initial File Name attribute. Instead, use the other connection string, or look here for more examples: http://www.able-consulting.com/ADO_Conn.htm

Finally, you don't need Access on your machine to connect to an Access database from within a Web app. Obviously, you do need Access to change the structure of the database: i.e. add tables, rename columns etc.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #5 (permalink)  
Old June 4th, 2004, 05:42 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks Imar -

I am going to go take another crack at it.



  #6 (permalink)  
Old June 6th, 2004, 06:24 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok - now a different problem. I am assuming there is an easy answer.
Hoping at least :D

Here is how I installed MSDE by the by, not sure if it's the recommended way, but I am just using mine for practice purpose to follow along in the book.

I followed the tutorial at http://www.symmetricwebsites.com/art...iguration.aspx

I kept mine to pull from C:/ instead of switching like he did. My setup file looks like :
[Options]
SAPWD="******"
DISABLENETWORKPROTOCOLS=0
SECURITYMODE=SQL
DATADIR="C:\MSDE2000A\DATA\"

Currently I am using the connection string :

objConn.Open "Provider=SQLOLEDB;" & _
           "Data Source=VAIO;" & _
           "Initial Catalog=Movie;" & _
           "User Id=SA;" & _
           "Password=******"

My error message is :

ADODB.Connection.1 error '80004005'

SQLState: IM002
Native Error Code: 0
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified


/begASP/Connect.asp, line 29

Am I getting closer

thanks!
patrick


  #7 (permalink)  
Old June 7th, 2004, 02:28 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Did you look in the folder: C:\Program Files\Microsoft SQL Server ?

What did it say?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #8 (permalink)  
Old June 7th, 2004, 12:55 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

nope - nothing with a $ in front of it -- but a whole mess of other folders and files that I have no idea what they are.

I am supposed to but the MovieMSDE file in this directory -
C:\MSDE2000A\DATA

or this one

C:\Program Files\Microsoft SQL Server\MSSQL\data

thanks for all the help IMAR
-patrick

  #9 (permalink)  
Old June 7th, 2004, 01:20 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Where you out your MDF file is the next step. However, you first need to figure out a way to connect to your MSDE instance.

What you could do is download the trial version of SQL Server. It comes with Management Tools like the Enterprise Manager which makes administrating your MSDE much easier. There are other alternatives available as well, but the EM is pretty easy to use.

You can also reinstall MSDE with a new instance name (you can have multiple MSDE installations coexist). In the setup folder of MSDE, type this: Setup BLANKSAPWD=1 INSTANCENAME=MyInstanceName

This will create a new instance of MSDE which you can connect to using MyMachineName\MyInstanceName

Don't forget to change the SA password later, and then use another account to connect to your MSDE.

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expanding on chapter 6 and the movie site in gen newbreed65 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 September 27th, 2008 11:56 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM
Errors on Chapter 12 example(12.8) sonnie ASP.NET 2.0 Professional 2 June 7th, 2006 10:55 AM
example in chapter 12 peterml JSP Basics 0 August 23rd, 2003 08:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.