Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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
 
Old October 19th, 2003, 03:53 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default connection string

Guys,

when I try to connect to my database on my ISP the computer tells me this: -

'C:\premfs3\sites\premium8\adnanarab66\database\Ho use.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

I use this string: -
String strConnect = "Provider = Microsoft.Jet.OleDb.4.0; data source=\\premfs3\\sites\\premium8\\adnanarab66\\da tabase\\House.mdb;";

what am I doing wrong?? The thing is, is that I am not suppling a specific drive and it automatically allocates the C:\ drive??

Any ideas

Thanks

Adnan Arab


__________________
Adz - Learning The J2EE Ways.
 
Old October 19th, 2003, 03:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, if you don't specify a specific location, it will assume the current drive, which is usually C.

Where is your database located? If you only now its virtual location, you can use Server.MapPath to retrieve its location on disk. If the file is on a network drive, you'll need to add two additional \s to the path.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 19th, 2003, 08:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

An easy way to get the connection string right is to use the .udl connection string wizard

http://support.microsoft.com/default...NoWebContent=1

There are other articles on its use out there but this should be engough.

======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old October 20th, 2003, 02:50 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kashif Send a message via MSN to kashif Send a message via Yahoo to kashif
Default

[/dear fellow i wonna make connection in teh Data Accesss Layer make is use all over the the application please help me to get the results and basically i am ought to make institute web site as project ..
thX [font=Trebuchet MS]

PEACE
 
Old October 20th, 2003, 08:43 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default

Thanks guys for your replys,

Imar, your soultion worked thank you very much

Ads






Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection string MunishBhatia ASP.NET 2.0 Professional 4 May 16th, 2007 05:50 AM
Connection String jmss66 Oracle 4 August 8th, 2006 03:19 AM
Connection String slgknjn VB Databases Basics 2 February 26th, 2005 03:14 AM
Connection String fs22 Classic ASP Databases 3 August 30th, 2004 01:25 AM
Connection String Help. diamond2165 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 7th, 2003 06:09 AM





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