Just a quick (perhaps strange) question...

Odelle
04-19-2004, 03:38 PM
Hello. I need some help accessing a Microsoft Access 2000 database from Visual Basic 6. Although I know a fair amount about Visual Basic, I know very little about connecting it with Access. I have read through much of the tutorials, but unfortunately still have a problem.

>> I want to be able to add/delete/edit a single database as I would a random/sequential file.

As I said, I do not know a great deal about databases, but I can say I don't use things like: 'Dim blah As New ADODB.Connection'

I have tried the standard: dtaBlah.Recordset.AddNew... dtaBlah.Recordset.Delete, etc. But these seem to require SQL statments which then force me to use *two* databases.

*I just want to treat it like a file, please!*

Thank you *very* much for your help.

MKoslof
04-19-2004, 03:47 PM
1) An sql statement does not require you to use two databases, I have no idea where you got that impression.

2) Don't use ADODC controls, use standard ADO recordsets and connections. There a good tutorial for ADO beginners in the knowledge base

3) Trust me, you want to learn SQL. You don't want to treat your database like a file, you want to treat it like a database. While Access really is a "flat file" system, if you ever get into real database engines such as SQL Server and Oracle, you will thank yourself.

HardCode
04-19-2004, 03:47 PM
Databases are not files, and can't be treated the same. If you want to use a backend that acts like a file, just keep using files :)

loquin
04-19-2004, 03:52 PM
I want to be able to add/delete/edit a single database as I would a random/sequential file.

*I just want to treat it like a file, please!*
Sorry, but you can't. It's not a file... but it's a lot better in most ways.

You need to establish a connection, and open a recordset to view. Then, you can just move through the recordset.

There's many ways of updating the underlying tables. I normally just create a SQL update or Insert statement, and use the connection.execute to actually perform the update.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum