Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 22nd, 2004, 11:53 AM
Authorized User
 
Join Date: Sep 2003
Location: Newmarket, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default off topic - was database connection

Hi again Imar

I have a question regarding the connection file that we use in the footie project. Everything works great on my local server, but I am having trouble working out how to edit it for Brinkster.

On their site for the 'general' [ie free] accounts, they say you should connect thus:

Set oConn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
             "Data Source=" & Server.MapPath("\UserName\db\dbname.mdb") & ";" & _
             "Persist Security Info=False"
oConn.Open(sConnection)
'...
oConn.Close



If you are not using Server.MapPath, then you can change :
Data Source=" & Server.MapPath("\UserName\db\dbname.mdb") & ";" & _

To the following:
"Data Source=\\genfs#\www##\UserName\db\dbname.mdb" & ";" & _

# = the number of your file server

## = the number of your server



I'm a bit confused as to how to incorporate your information with theirs, so that we retain everything we need to drive the events page etc, but still connect to the database in the right way for them.

the information I posted here can be found at http://www.brinkster.com/Kb/Kb.asp?kb=53890

Thanks in advance
Anne
:)
  #2 (permalink)  
Old January 22nd, 2004, 12:37 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Well, IMO, Server.MapPath is the way to go. This means that even if they change the physical location of your Web site, your code will still work. I think you should do as they tell you and out the database in the DB folder and then use MapPath.

The only problem you run into is the difference between your local connection file and the remote one. They now no longer match, so you shouldn't overwrite the remote one with the local one anymore. Either skip the Connection file when putting your site, or, alternatively, put your local database in a folder called UserName\db in the root of your Web site.

If you continue with the footie project, I am sure that one day you will wonder "Now how in the world do I let my users sign up for my cool Soccer Events Site??" Well, easy, just follow this link: http://imar.spaanjaars.com/ViewConte...=4&CATEGORY=10
There are a few other book related articles on my site as well.

Does this help?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old January 23rd, 2004, 08:07 AM
Authorized User
 
Join Date: Sep 2003
Location: Newmarket, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Imar - I am OK with using Server.MapPath here. What I would like to know from you is how do I incorporate their code along with the code from your existing Connection file.

ie, how do I combine your code

Dim MM_connFootballSite_STRING
MM_connFootballSite_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\football_site\database\T heSoccerSite.mdb;User Id=admin;Password="


with theirs

Set oConn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
              "Data Source=" & Server.MapPath("\UserName\db\dbname.mdb") & ";" & _
              "Persist Security Info=False"
oConn.Open(sConnection)
'...
oConn.Close


I can see that the path to the database would change to
Data Source=" & Server.MapPath("\anne2ward\db\TheSoccerSite.mdb & "

and presumably I would append your User Id=admin;Password=" to this string?

but how do I combine the rest of your code and their code to make it understandable to them? does that make sense to you?

Also, I take your point about the changes that will work for Brinkster obviously not working for the local server. And many thanks for the link to the tutorial on your site for allowing new users to sign up.

Thanks again
Anne

  #4 (permalink)  
Old January 23rd, 2004, 05:33 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Well, I think you're almost there:

Change the connection string to this:

Dim MM_connFootballSite_STRING
MM_connFootballSite_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\UserName\db\TheSoccerSite.mdb") & ";User Id=admin;Password=;Persist Security Info=False;"

I think you'll find that all the stuff about Persist Security Info and the user account / password can easily be left out (i.e. just define the DataSource and the Provider), although I don't know how Brinkster deals with this.

At run-time, Server.MapPath will take the actual, physical, location of the file. This means the file at Brinkster will successfully point to the database at one of the Brinkster servers. During development, you'll need your own connectionstring, pointing to your own database. Like I said, you could move your database to a folder called \UserName\db\ as well, or you can define a second connection string in your connections page, and then comment out the Brinkster one at design time, and yours at run-time.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #5 (permalink)  
Old January 26th, 2004, 05:43 AM
Authorized User
 
Join Date: Sep 2003
Location: Newmarket, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Imar! You're an absolute star... it is working now, so if you want to check out the current version [complete with as usual very unbiased commentary ;) ] it is living at http://www25.brinkster.com/anne2ward/home.asp

I really owe you and your co-authors a big thank you for the book - I'm very much looking forward to finishing off some of the 'extras' on the footie site - such as the acceptance of new registrations etc, and also to the last section of the book focusing on MediaEdge. I really have found your football site project invaluable for guiding me through an area I desperately wanted and needed, in fact, for my future, to conquer.

Many thanks once again
Anne
:)

  #6 (permalink)  
Old January 26th, 2004, 11:20 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Cool. It looks really great.

It was close, but I could resist the urge to add an "Imar was Here" event in your Admin section......

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #7 (permalink)  
Old January 26th, 2004, 11:28 AM
Authorized User
 
Join Date: Sep 2003
Location: Newmarket, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

aww.. that would've been nice!
;)

go on... you know you want to!

  #8 (permalink)  
Old January 26th, 2004, 11:43 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Do you know a cat named Twuff??


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #9 (permalink)  
Old January 26th, 2004, 01:25 PM
Authorized User
 
Join Date: Sep 2003
Location: Newmarket, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

er, yes... fairly well in fact


she appeared in an earlier version of the site as a 'typical Wednesday supporter', wearing her most dejected expression and a blue hat!
:)

  #10 (permalink)  
Old January 26th, 2004, 01:29 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hmmm, just heard a rumour that she defaced your footie site..... ;)

Imar


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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection to Access Database reachsevar ASP.NET 2.0 Basics 1 November 28th, 2007 08:56 AM
ADODB connection fails (better topic) halfnote5 Access 6 September 5th, 2007 09:35 PM
Is this topic a professional topic?? mega ASP.NET 1.0 and 1.1 Professional 0 December 3rd, 2004 09:37 PM
Need help w/ Database connection brkd63 Dreamweaver (all versions) 1 August 5th, 2004 01:14 AM



All times are GMT -4. The time now is 08:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.