|
-
Mar 22nd, 2006, 06:06 PM
#1
Thread Starter
Hyperactive Member
Newbie need help with MS Access
Hi,
I usually only use MS Access a my database manager.
BUT today I have to create a module. Well I guess.
I need to do a massive change to the values of some tables so I have to get recordsets, apply updates on many tables.
--
I'm blocked on the first lines of code which are to open a recordset.
How do I refer to the database?
In VB its: rstData.Open mySQL, myConnection
In MS Access what is it?
If I don't specify a connection is crashes, if I try to open a connection the same way I would in VB is tells me that the database is in use (makes plenty of sense, i am in the database) .
--
So basically, I need to know how to establish the connection, open a recordset.
The rest I will figure out by myself as for the syntax. I guess it is close to VB.
Thanks.
-
Mar 22nd, 2006, 11:13 PM
#2
Re: Newbie need help with MS Access
VB Code:
VB Code:
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & App.Path & "\mydbase.mdb;"
Hi,
If you are making codes in the VBA editor of MS Access, just use the code above....You don't have to use the vb 6.0 connection above..Just refer to the code below if your going to make ado connections in MS access VBA.
VB Code:
Dim conn As ADODB.Connection
Set conn = CurrentProject.Connection
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|