473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Database Connectivity

Microsoft has a tutorial for ASP. There is a connection string in the
code
as follows:

DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\

How do I change this statement once I move the page to my web server?
I
have the database in my root folder.
Thanks

Jul 22 '05 #1
4 1318
Try using this, both locally and remotely:

Dim sConnectionString
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("/tutorial/guestbook.mdb")

Note that unless you've configured IIS so that read-access is denied to that
file or directory via HTTP, anyone in the world can download your database.
(Assuming that directory is a WWW-published directory.)

Ray at work
<MR********@comcast.net> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Microsoft has a tutorial for ASP. There is a connection string in the
code
as follows:

DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\

How do I change this statement once I move the page to my web server?
I
have the database in my root folder.
Thanks

Jul 22 '05 #2
On Mon, 27 Dec 2004 16:11:54 -0500, "Ray Costanzo [MVP]" <my first
name at lane 34 dot commercial> wrote:
Try using this, both locally and remotely:

Dim sConnectionString
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("/tutorial/guestbook.mdb")
As an explanation, Server.MapPath finds the actual physical path on
the system to the file beginning at the root of the web. So if your
file was physically at:

c:\inetpub\wwwroot\subfolder1\application\database .mdb

and your site's root was at:

c:\inetpub\wwwroot\

then the MapPath argument would be:

("/subfolder1/application/database.mdb")

Using MapPath ensure that the structure of your web site is followed,
no matter where the root of your site happens to be on the server.
Your ISP could have your root at H:\Webroots\BasicHostingPlans\Bob\
and as long as your structure of your site is the same as on your
home/development system you don't need to change the code.

Jeff

Note that unless you've configured IIS so that read-access is denied to that
file or directory via HTTP, anyone in the world can download your database.
(Assuming that directory is a WWW-published directory.)

Ray at work
<MR********@comcast.net> wrote in message
news:11**********************@z14g2000cwz.googleg roups.com...
Microsoft has a tutorial for ASP. There is a connection string in the
code
as follows:

DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\

How do I change this statement once I move the page to my web server?
I
have the database in my root folder.
Thanks


Jul 22 '05 #3
Jeff,

Do you offer consulting (tech support) by the hour? If so what is your
fee?

Thanks

Jul 22 '05 #4
On 27 Dec 2004 18:06:00 -0800, MR********@comcast.net wrote:
Do you offer consulting (tech support) by the hour? If so what is your
fee?


Contact me via email at:

jeff at zina dot com

Jeff
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
1
by: harish | last post by:
I am using java applications to connect to my MS SQL Server database. I am using ODBC for database connectivity. If i am running my java applications in a remote PC and try to connect to database...
3
by: junaid | last post by:
Hi to all, Can it is possible to connect to the databse like postgre or mysql through a C programm? I know the basics of C and I have developed a small program which uses a file for the...
3
by: Niks | last post by:
Hi, I need to connect to SQL server Database using a System DSN. Can anyone tell me how to connect to SQL Server using DSN in ASP.NET (VB.Net). Using a Try Catch block. Does anyone know how to...
8
by: David | last post by:
Hi, Could someone please xplain how to add a field to an existing SQL table in VB.Net I have added the field in the Server Explorer and it shows up when I reload the program but I cannot...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
47
by: Ivan Weiss | last post by:
Hi all, I am just getting started on a new app and am a rusty VB6 guy who is looking to create something on the side to serve as a corporate workbench for my company. ADO.net is new to me so...
0
by: dalaimanoj | last post by:
I have a form with buttons 'View', 'Save', 'Delete', 'Edit' and some textboxes to input data.. On clicking each buttons the database is connected and the respective action is done. For example...
4
by: ykhamitkar | last post by:
Hi there, I am trying to create a web based dataentry application in java applet. When I create a standalone application using applet the database connectivity works fine. However when I use same...
0
Dököll
by: Dököll | last post by:
ASP.NET and SQL Server 2005 Database interaction includes: Language: ASP.NET Connectivity: SQL Server 2005 Foreword: This database connectivity is nothing of genius, it is a simple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.