Results 1 to 2 of 2

Thread: Newbie need help with MS Access

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    369

    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.

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: Newbie need help with MS Access

    VB Code:


    VB Code:
    1. conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    2.       "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:
    1. Dim conn As ADODB.Connection
    2. Set conn = CurrentProject.Connection

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width