Re: Database Stuff
- From: "Laurie Comerford" <laurie.comerford@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Apr 2008 18:22:07 +1000
Hi Mike,
You don't have to have Access installed to use it's file format.
You can easily use the ADO tools to read/write/modify Access files.
Set your reference to the latest version of the Microsoft ActiveX Data
Objects 2.x library.
The file is C:\Program Files\Common Files\System\ado\msado2x.dll.
You should be able to download at least v2.7 from Microsoft.
I define a number of Public variables and use the following code:
Public ogAccess As New ADODB.Connection
Public ogRS As New ADODB.Recordset
Public Const scMsgHeader = "Landscape"
Public Const sgDatabase =
"C:\Documents\Development\Landscape\Data\StructuredPlants.mdb"
Public ogCmmnd As New Command
Dim sQry As String
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function CloseDataBase()
Set ogCmmnd = Nothing
Set ogAccess = Nothing
End Function ' OpenDataBase
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function OpenDataBase()
Debug.Print sgDatabase
Set ogAccess = Nothing
If FileExists(sgDatabase) Then
ogAccess.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" &
sgDatabase & ";"
ogCmmnd.ActiveConnection = ogAccess
ogCmmnd.CommandType = adCmdText
End If
End Function ' OpenDataBase
The only other item you need is a book on SQL (unless you already understand
it).
--
Regards
Laurie Comerford
"Mike Williams" <mikea@xxxxxxxxxxxxxxxxx> wrote in message
news:Ou8c4scqIHA.3616@xxxxxxxxxxxxxxxxxxxxxxx
Being a hobbyist and writing mostly stand alone utilities for myself and
friends I have always "rolled my own" database structures (using various
methods including fixed size records and / or various linking arrangements
for variable sized records) and they have always previously suited my
purposes, being just about as fast as anything you can get but, of course,
being specific to my own particular stand alone application and being
unsuitable for read and write access by more than one person at a time.
Now my daughter has asked if I can write something for her which performs
the sort of tasks and creates the sort of displays that I've always done
before, but which can be used by a number of separate people on a number
of separate machines such that each person is accessing the same database
at the same time for both read and write operations and, if necessary, for
the creation of new records. I'm fairly sure that given enough time I
could come up with my own "home brewed" data structure and controlling
code which would allow such a thing, but even after just a very short
consideration I can already see lots and lots of hurdles that I would be
required to jump and, of course, I don't want to reinvent the wheel.
Also, it would be nice if the main database was in a standard format so
that it could, if necessary, also be read by other applications (although
that is not an essential requirement). I don't want to use Access or
anything similar because I want my application to run on machines where
Access will probably not be installed. I have never actually dipped my
toes into this client / server corporate database water before (if that's
what it's called) and I would really appreciate it if anyone could give me
any tips / pointers and any general "outline explanations" or perhaps even
provide some links to any suitable tutorials which are VB6 specific?
Mike
.
- References:
- Database Stuff
- From: Mike Williams
- Database Stuff
- Prev by Date: Database Stuff
- Next by Date: Re: Please stop Mike Williams
- Previous by thread: Database Stuff
- Next by thread: Re: Database Stuff
- Index(es):
Relevant Pages
|