acess 2007 + connect sql server 2000 (1 Viewer)

Raoulh79

New member
Local time
Today, 12:03
Joined
Oct 8, 2009
Messages
2
Hi everybody,

I am using Access 2007, i am trying to connect to sql server 2000 from a form in access 2007. I havent done this before, after some search i tried this code, can you advise me if it is correct:


Dim connsql1 As String
connsql1 = "test"

Dim connection1 As SqlClient.SqlConnection

connection1 = SqlClient.SqlConnection("Data Source=ServerName;Initial Catalog=DatabaseName;User Id=sa;Password=sa")

Dim myCMD As SqlCommand
myCMD = "select count(n0_period_no) from plu"
Text1.Text = myCMD


First of all i want to get an input from the program that the connection succeded, that is why i run this query and i want to display the result in the textox...


Any ideas are really appreciated,


Best Regards
 

jardiamj

Registered User.
Local time
Today, 02:03
Joined
Apr 15, 2009
Messages
59
You have to create an ODBC connection, and then you can access the MySql database by using linked tables or by using VBA code using the ADOB SQL ODBC provider.
 

Users who are viewing this thread

Top Bottom