Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with a access database and VB6

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
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")










 
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..
 
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.
 
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
 
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
 

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top