IonicWind Software

IWBasic => Database => Topic started by: Brian on April 12, 2007, 03:35:49 AM

Title: Connect to Database
Post by: Brian on April 12, 2007, 03:35:49 AM
Hi,

If I put my Access .mdb on a server or PC, how do I go about getting people
to connect to it?

Do I use a User DSN, File DSN or System DSN? How do I share it so you can
set up an OBDC DSN>

I realise that EBasic uses dbConnectDSN to achive the connection, but it's the
hosting end that I need to get my head around

Thanks,

Brian
Title: Re: Connect to Database
Post by: Vikki on April 13, 2007, 02:12:50 PM
Hi Brian,

What type of hosting do you have?

If it is Windows then you can put your mdb in the pdb folder on your site. That folder has read and write permissions plus it's protected in some fashion. Someone will correct me if I'm wrong I hope.  ;)  If it's on another type of server I'm not sure how to set it up.

On a windows server with web pages you use asp pages or aspx pages to interact with it and use a connection string in the asp page or an included page to gain access to the data in the db.

There are really no hosting end issues with the exception of the type of hosting you have. Windows is set up for Access db's in the pdb folder. Other types of servers may or may not be.

If you are accessing the db through your program and it is on a server you can use dbConnect or dbConnectDSN I believe. I haven't tried it yet and one of the connection strings below I believe.

Some connection strings are below:

1.  Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;

2.  Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;SystemDB=C:\mydatabase.mdw;

3.  Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Exclusive=1;Uid=admin;Pwd=;

For the location of the database you would use the server path.

The one I used the most when I used Access for db's is number 1. I don't generally use Access anymore online because of the limitations. The docs says 10 simultaneous users but I think 30 is a better number before the db has trouble and quits functioning or has other troubles. If you think you are going to have more than 30 connections at one time then you might think about using a different type of db.
Title: Re: Connect to Database
Post by: Brian on April 14, 2007, 03:03:39 AM
Thanks, Vikki, just what I needed. It is definitely a Windows network it will be running on,
but I don't think they have an Access server. Will have to figure it out from there . . .

Thanks again,

Brian
Title: Re: Connect to Database
Post by: Vikki on April 14, 2007, 08:26:19 AM
Hey Brian,

There is no Access server per se... you just put your mdb in the pdb folder and wallah you can access it from there. It is not like SQL server or something like that. Access does not require a server to function in the way you are thinking I think. :-) If you don't have a pdb folder on your site already then ask tech support about it. Usually it (the pdb folder) is part of the IIS installation that I can recall and should be in your root directory.
Title: Re: Connect to Database
Post by: Brian on April 14, 2007, 10:02:42 AM
Vikki,

Got that - thanks

Brian
Title: Re: Connect to Database
Post by: peterpuk on April 14, 2007, 06:25:42 PM
Brian,

It might not be the same as your configuration, but I test my databases on my little peer to peer network.

I have three computers connected together that can share folders, printers etc. One computer is W98, the others are XP.

I copy the application and database into a test folder on my development computer, and place a copy of my application onto the other two computers. Then I run the application from each computer at the same time to see how it hangs together, record locking and such...

On the computers without the database, I find out the path name to the database by having a 'connect to database subroutine' which throws up the file OPEN dialog, then this is passed to the OpenDB routine.

This is generally all you need to do, even if it is another type of network. For example, at my wifes work, their network server appears as an I: drive, and so that's treated the same as any other drive on the computer. Of course the user must have the correct permissions etc.





Title: Re: Connect to Database
Post by: Brian on April 15, 2007, 08:11:14 AM
Peterpuk,

Good solution. Do I have to do anything about record locking, etc, and how does it manifest
itself to a user if a record is locked?

Brian