cheikhanio
04-10-2008, 08:28 PM
hi all
how to create a database (by system files System.IO and System.Data.OLEDB) in order to add tables in this database.
the following procedure does not function because create a file with format unknown
private sub createDB()
io.file.create("c:\base.mdb")
end sub
Dude, what?
Are you writing an install script?
If you aren't, you don't need to recreate it every time you run the program.
If you are, you probably need to specify a scheme, or structure, or a filetype, just doing it like you do there will just create a useless blob of binary or something, afaik.
In fact, I'd not bother creating it through VB at all if you're just writing something akin to a graphical interface with a dbase backend.
I'd just make the database through access, and connect to it.
Here's a code-sample, though. (http://bytes.com/forum/thread369481.html) (The second post.)
It's from 2005 so it might be easier to do with current .Net, or maybe it needs doing slightly different. But it's a a start.
More. (http://www.freevbcode.com/ShowCode.asp?ID=5797)
You'll need ADOX for either example.
Powered by vBulletin® Version 4.2.3 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.