Home All Groups Group Topic Archive Search About

Newbie: ADO - Access Connection string

Author
14 Oct 2005 9:47 AM
smith
Hi,

Surprisingly, i cant seem to find a simple and descent ADO-Access example.
There are tons of stuff on the web but, especially the connection strings,
are a bit different from each other.

Are there any good links / suggestions regarding connection strings (should
i use OLE, ODBC, etc.) and general SQL command manipulation?

What would my best option be if i want my application to run on anything
from Win98 to XP ?

BTW is there NOT a way to DROP a table using ADO? I think i read this
somewhere and surprised me. Is it true?

Thanx in advance!
-steve

Author
14 Oct 2005 11:09 AM
Martin de Jong
Take a look at the MZ-Tools, a freeware addin:

http://www.mztools.com/v3/mztools3.htm

it has a ADOstring generator too.

Martin de Jong

I myself made an addin for extracting officeimages and add them to our
resource file or any selected control. It has other functions too.
(HelpContext, ADOstring, Errorhandler)

Show quoteHide quote
"smith" <jsm***@yahoo.ca> schreef in bericht
news:s8L3f.6196$S43.955056@news20.bellglobal.com...
> Hi,
>
> Surprisingly, i cant seem to find a simple and descent ADO-Access example.
> There are tons of stuff on the web but, especially the connection strings,
> are a bit different from each other.
>
> Are there any good links / suggestions regarding connection strings
(should
> i use OLE, ODBC, etc.) and general SQL command manipulation?
>
> What would my best option be if i want my application to run on anything
> from Win98 to XP ?
>
> BTW is there NOT a way to DROP a table using ADO? I think i read this
> somewhere and surprised me. Is it true?
>
> Thanx in advance!
> -steve
>
>
Author
14 Oct 2005 1:06 PM
Ralph
Show quote Hide quote
"smith" <jsm***@yahoo.ca> wrote in message
news:s8L3f.6196$S43.955056@news20.bellglobal.com...
> Hi,
>
> Surprisingly, i cant seem to find a simple and descent ADO-Access example.
> There are tons of stuff on the web but, especially the connection strings,
> are a bit different from each other.
>
> Are there any good links / suggestions regarding connection strings
(should
> i use OLE, ODBC, etc.) and general SQL command manipulation?
>
> What would my best option be if i want my application to run on anything
> from Win98 to XP ?
>
> BTW is there NOT a way to DROP a table using ADO? I think i read this
> somewhere and surprised me. Is it true?
>
> Thanx in advance!
> -steve
>

You are talking about ADO and not ADO.Net. Correct?

I find that a bit strange. Many MS examples now use SQL Server, but there
are still a ton of mdb examples.. I guess it depends on how you define
'simple and descent' <sp?>

There is very little difference between datasources when accessed by ADO,
just substitute a different connection string. That is the design goal of
ADO, to be data source transparent. There will be slight variations between
SQLs - wildcards, etc. But you can check these out using MSAccess Help.

For DDL manipulation check out the ADOX library.

Get you started ...
Dim sSQL As String = "select * from authors"
Dim sCONNECT As String = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security
Info=false;Data Source=C:\Program Files\Microsoft Visual
Studio\VB98\Biblio.mdb"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthaddnewx.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthaddnewx.asp

http://directory.google.com/Top/Computers/Programming/Databases/ADO/

hth
-ralph
Author
17 Oct 2005 2:09 PM
Paul Clement
On Fri, 14 Oct 2005 08:06:25 -0500, "Ralph" <nt_consultin***@yahoo.com> wrote:

¤
¤ "smith" <jsm***@yahoo.ca> wrote in message
¤ news:s8L3f.6196$S43.955056@news20.bellglobal.com...
¤ > Hi,
¤ >
¤ > Surprisingly, i cant seem to find a simple and descent ADO-Access example.
¤ > There are tons of stuff on the web but, especially the connection strings,
¤ > are a bit different from each other.
¤ >
¤ > Are there any good links / suggestions regarding connection strings
¤ (should
¤ > i use OLE, ODBC, etc.) and general SQL command manipulation?
¤ >
¤ > What would my best option be if i want my application to run on anything
¤ > from Win98 to XP ?
¤ >
¤ > BTW is there NOT a way to DROP a table using ADO? I think i read this
¤ > somewhere and surprised me. Is it true?
¤ >
¤ > Thanx in advance!
¤ > -steve
¤ >
¤
¤ You are talking about ADO and not ADO.Net. Correct?
¤

It doesn't matter since both use same ODBC and OLEDB drivers.


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
14 Oct 2005 1:09 PM
Jeff Johnson [MVP: VB]
"smith" <jsm***@yahoo.ca> wrote in message
news:s8L3f.6196$S43.955056@news20.bellglobal.com...

> Surprisingly, i cant seem to find a simple and descent ADO-Access example.
> There are tons of stuff on the web but, especially the connection strings,
> are a bit different from each other.

http://carlprothman.net/Default.aspx?tabid=81

> BTW is there NOT a way to DROP a table using ADO? I think i read this
> somewhere and surprised me. Is it true?

There are two broad classes of things you can do with databases, and in SQL
they're called DML (Data Manipulation Language, i.e., SELECT, INSERT,
UPDATE, DELETE) and DDL (Data Definition Language, which deals with altering
the structure of the database: CREATE, DROP, GRANT, etc.). ADO is about DML.
ADOX is about DDL.

Of course you could always use ADO's Connection.Execute method to run any
SQL statement, so you could drop tables that way. There's just no dedicated
method for doing it.
Author
17 Oct 2005 2:16 PM
Paul Clement
On Fri, 14 Oct 2005 05:47:01 -0400, "smith" <jsm***@yahoo.ca> wrote:

¤ Hi,
¤
¤ Surprisingly, i cant seem to find a simple and descent ADO-Access example.
¤ There are tons of stuff on the web but, especially the connection strings,
¤ are a bit different from each other.
¤
¤ Are there any good links / suggestions regarding connection strings (should
¤ i use OLE, ODBC, etc.) and general SQL command manipulation?
¤

OLEDB is preferable to ODBC. With respect to Access it is the more stable data access provider.

¤ What would my best option be if i want my application to run on anything
¤ from Win98 to XP ?
¤

You will probably still need to distribute the Jet database components for the older systems.

¤ BTW is there NOT a way to DROP a table using ADO? I think i read this
¤ somewhere and surprised me. Is it true?

Yes, you can DROP a table using Access SQL DDL. The following doc should help:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acfundsql.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acintsql.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp


Paul
~~~~
Microsoft MVP (Visual Basic)