 |
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 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
|
|
|
|

January 22nd, 2004, 11:53 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
:)
|
|

January 22nd, 2004, 12:37 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

January 23rd, 2004, 08:07 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

January 23rd, 2004, 05:33 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

January 26th, 2004, 05:43 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
:)
|
|

January 26th, 2004, 11:20 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

January 26th, 2004, 11:28 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
aww.. that would've been nice!
;)
go on... you know you want to!
|
|

January 26th, 2004, 11:43 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Do you know a cat named Twuff??
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

January 26th, 2004, 01:25 PM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
:)
|
|

January 26th, 2004, 01:29 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hmmm, just heard a rumour that she defaced your footie site..... ;)
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |