VB and Access some issues

thhynes

Member
Joined
Dec 16, 2004
Messages
7
Location
Hartford, CT
Programming Experience
Beginner
Okay,

So heres the scoop, signed up at a local community college to relearn VB, first night of class was last night, and some things are flowing back to me quite quickly from what I learned about VB 7 years ago....

My problem is that I can not figure out why VB wants to have a SQL server...

I am in the process of writing a small program to use at a vets office inwhich I work to update the reservation of cages for birds that are going to be boarding with us....

Everytime I try to get VB to access the ACCESS data base I keep getting
connect to server, password, etc....

question: why, I am not on a server this is a home computer
does VB net recognize microsoft access and if not
will i need to purchase a a database program that will set files
up as MDF format and not access format?
 
How are your trying to access the Access db?

Tg
 
I really do not understand the question:

Wouldnt you just tell it to access the database you want and than display the records with in that database?
 
"Wouldnt you just tell it to access the database you want and than display the records with in that database?" -- and HOW are you doing that? As in either 1) "I did this, then this then that then...." or 2) the code you are using that's in question. How you use an Access DB is different from how you would use a SQL Server db. That's where I think the problem might be. You maybe trying to use SQL Server stuff when you should be using something else.

-tg
 
DIfferences in versions.

I Think (note a big empahsis on that) you ran into something I did. I first looked at VB before it went .NET, and a lot of the database stuff has changed alot since it went to .NET. Now I have a limited understanding, but what you have to do is actually tell the program in the code where the database is, how your going to connect to it (both of these are in a thing called a connection string), a name for the actuall connection to the database, and of course, the Query of what you actually want. The query CAN be written in SQL, but you don't have to have SQL on the machine. If you are using an MS Access Database (usualy they have an .mdb extension) you can use the built in JET engine to get at it. now most here have a better handle on it than I do, but I use the OleDB stuff, so some things you might want to punch into the help to search for are

OleDBConnection
OleDBCommand
OleDBDataReader
Query

there are others as well, which I don't understand as much

OleDBDataAdapter
OleDBDataSet

etc etc. Hope this helps you out some. In terms of the asking for passwords and such, when you define how it will connect to the database, and where the database is, you can specify any needed login and passwords, and some security realted things so the end user doesn't have to. If you want to just see some connections strings, there is a www site with very common ones, at www.connectionstrings.com if you want a place with some examples of very basic ones. Using them effectively though is somethign I am not qualified to help you do.
 
Last edited:
Back
Top