×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problems with a access database and VB6

Problems with a access database and VB6

Problems with a access database and VB6

(OP)
Hello, I've got a access database (usuarios.mdb) with a table (Clientes).

When I put the next code the compiler says 'error: user type not defined' (refered to database)


    Dim db As Database
    Dim dr As Recordset
    Dim varMarcador As Variant
    Dim strMensaje As String

 
    Set db = DBEngine.Workspaces(0).OpenDatabase("C:\Jorge\ciborg\Usuarios.mdb", False, False)
        ' De modo predeterminado es dbOpenTable; se
        ' necesita si se va a utilizar la propiedad Index.
    Set dr = db.OpenRecordset("Clientes")










RE: Problems with a access database and VB6

Sounds like Access cant find the types refered to in your code and assuming they are user-defined. With Access 2000 via vb6 - you have to reference DOA explicitly for that code to work.

Personally I do not use Access 2000 to develop applications unless I am working on a customers database that is already in 2000 as its crap compared with access 97. If I were you, I would consider obtaining a cheap copy of Office 97 professional and the developers toolkit. When Microsoft released Office 2000 - I went out and bought a copy, more fool I.

Anyway, just go to the References menu and Add MIcrosoft DAO 3.6 and the code should work fine. Its just an example of how MS messed up a perfectly good RAD database tool.


Hope this helps..

RE: Problems with a access database and VB6

Access 2000 is crap? It packs a lot more functionality than Access 97.  For one you have Access Data Projects, which give you far superior ability to use Access as a client-server application.  I haven't had ONE problem with Access 2000.  I usually find that people who call applications crap usually aren't able to use the full the application to its capabilities.

RE: Problems with a access database and VB6

hi

first. What controls do you have on your form. i mean when you acccess that database what are u going to do form there?

will it be displayed in a listview, combobox? What??

alistair4267

RE: Problems with a access database and VB6

could it think clientes is an undeclared variable ?

try something like this ...

Set dr = db.OpenRecordset("SELECT * FROM clientes")

not sure of exact syntax as no references here now

good luck ...
    

Best of Irish Luck, David.
djwilkes@hotmail.com

RE: Problems with a access database and VB6

(OP)

  Hello.

  I have some problem dealing with the SQL statement in
  VisData.
  When the SQL is

  "SELECT * FROM Customers " the execution run suceessfully.

   But,when the SQL is
 
   " SELECT * FROM Order Details " the error message shows
   ' Syntax Error in FROM clause'

   Is that any other ways to retrive the data? This is because have a lot of existing file names that have 2 strings, seperated by a space.
     
   TQ

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close