> >
> > Dear Joe
> > Simply create a system DSN – Microsoft Access driver (mbd)and the data source name as “mydatabase”. No need to connect it to any database at all.
> > Create a form
> > In the Init enter
> > Public mydatasource
> >
> > create a command button name it as connect. In the click event
> > If mydatasource <= 0
> > cDsnName = "mydatabase"
> > cPwd = 'mypassword'
> > cDb= "mydatabase.mdb" && with full path
> > If !File(cDb)
> > Error Message here
> > Return
> > Endif
> > aAnnStr = "DSN=" + cDsnName + ";DBQ=" + cDb + ";DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;PWD=" + cPwd + ";UID=admin;"
> > Store Sqlstringconnect(aAnnStr) To mydatasource
> > If mydatasource <= 0
> > Messagebox('No connection',0,'')
> > Endif
> >
> > Endif
> > In the Right Click Event (To disconnect)
> > If mydatasource > 0
> > aAnn =SQLDisconnect(mydatasource)
> > Store -1 To mydatasource
> > Endif
> > Save and run click on the command button
> > Open your data form go to dataenvironment window.
> > Now from the dataenvironment select Add cursoradaptor, right click on the cursor adaptor select builder. In the very 1st page select Data Source Type :ODBC. Then select Use exsisiting connection handle, enter mydatasource in Capital letter. Then go to page 2 Data Access. Select Build. Your tables from the database will be there. Enjoy the rest.
> > You can store the connection and disconnection procedures in a class and use it when you call your data form.
> > Do not forget to disconnect from the data source after your work is completed.
> > Now think about the possibilities of variable 'cDb'. You can store the data path or path to the your database in a field and retrive it. This means you can place your databases to any location you wish. Simply update the new location through a program if it is changed by the user, means the database is shifted to a new location.
> > With Regards,
> > Biju Thomas
>
> Hello Biju,
> Thanks for sharing your ideas, I appreciate it very much. Just the idea I'm looking for...
>
> regards,
> joe
I am still a kid in this programming world, just started walking, lot more to learn. That is not my own idea. The pieces were joined by lot of other friends in this community. It was a final product of team work. So, I dedicate that rating to all my friends in this community, especially to our beloved Ken.
Warm Regards,
Biju Thomas