RATE THIS ANSWER
0
Click to Vote:
0
0
Last Answered:
Feb 29 2008 6:30 AM GMT
by Jlees
This code snippet is for a Access Database on the local machine. The methods properties for provider and data source would be different for a server based database. As it stands, this code will not work with anything other than an access database on the local system-- which might be good enough since the JET engine can be used regardless of whether access is installed on the system or not. (Though I don't know that you can use any version of access to create the database, since I normally connect to a SQL DB with my little pieces of code.)
As for the information you need, you'll need to know:
The Database software type and version (MS SQL 2000/2005/2008, MYSQL4/5, etc)
The Server Name or Full DNS name
The Port used by the SQL Server
The database name and table names
The username and password that is able to connect to the server
Finally, if the server is even available to you to connect. (I.E. if you are attempting to connect across the internet, it might be firewalled off from you)