vb6 writing to access database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ckarnuth
    New Member
    • Feb 2008
    • 5

    vb6 writing to access database

    I have a program that i have created, that has a form that the user enters information into, clicks a command button and the information is transmitted to another form for verification. on the verification form, i need it to then write the information into an access database, however I have not the slightest clue where to begin to set this up.
    I have tried to use an odbc connection and had no luck. I am not familiar with the sql language at all, which is another problem that i am facing.

    i have already stored all of the information as public variables, but can't get them into the database.

    Any help would be appreciated. thanks in advance.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    This topic has alreaady been discussed several times here in the forum. Please use the search box on top right side of the page for the same. Also check in the HowTo section for some related articles.

    Comment

    • ckarnuth
      New Member
      • Feb 2008
      • 5

      #3
      Thank you, that helped, i have found the code to do what I need, however now I am experiencing another issue. when I try to run the program I get this error.

      run-time error 3343
      unrecognized database format

      this is the code that I am using as a test, only inserting one field to make sure that it works before I code all 35 fields.

      Code:
      Dim My_Database As Database
          Set My_Database = OpenDatabase("C:\Users\Ckarnuth\Desktop\Auxilary Club Program\Master List.mdb")
          My_Database.Execute "insert into Master List.Members(FName) Values('" & strFName & "')"
          My_Database.Close
      I am using VB6 and also running Windows Vista on my pc, don't know if that is the cause or not.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Try to convert the access file to 97 format and then use.

        Comment

        • ckarnuth
          New Member
          • Feb 2008
          • 5

          #5
          Not to sound like a complete Newbie, but how do you convert the database to 97, never had to do that, so i have no clue

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            check the menu database utility ------> convert database.

            Comment

            • ckarnuth
              New Member
              • Feb 2008
              • 5

              #7
              converted the database into a 97 format and now I am receiving a syntax error in the insert statement.

              here is the insert statement.
              Code:
              My_Database.Execute "insert into Master List97.Members(FName) Values('" & strFName & "')"

              Comment

              • Patil Shankar
                New Member
                • Feb 2008
                • 1

                #8
                please,
                devl.me soft. that mscit exam demo neet by code me program

                Comment

                • ckarnuth
                  New Member
                  • Feb 2008
                  • 5

                  #9
                  Originally posted by Patil Shankar
                  please,
                  devl.me soft. that mscit exam demo neet by code me program
                  what, i don't understand your post ?

                  Comment

                  • lotus18
                    Contributor
                    • Nov 2007
                    • 865

                    #10
                    Originally posted by ckarnuth

                    [CODE=vb]My_Database.Exe cute "insert into Master List97.Members( FName) Values('" & strFName & "')"[/CODE]

                    What is List97.Members ?

                    Comment

                    Working...