Dear Friends,
I know that by VB EXPRESS can connect only by code to database in SQL SERVER EXPRESS.
Now I have try with the code below but obtain this error:
Dear Friends,
I know that by VB EXPRESS can connect only by code to database in SQL SERVER EXPRESS.
Now I have try with the code below but obtain this error:
Connect to SQL SERVER EXPRESS only by code from VB EXPRESS
Puneetm
Public Const connectionString As String = "Data Source=CASA\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True;"
Is the machine you are running this VB Code on called CASA or is CASA a different remote machine.
This connection string is a SQL Server Connection string and not a SQL Express One.
The SQL Express connections normally will be something like
"Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Database=dbname;Trusted_Connection=Yes;"
- or -
"Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;"
(use |DataDirectory| when your database file resides in the data directory)
The fact that SQL Express is a local database solution also normally means that it would have a server parameter set as .\SQLExpress rather than CASA\SQLExpress which may imply you are trying to run it on a remote machine.
Omen
Mike Williams28205
emilychou
Dear Spotty
I have already written successfull a code for connection to a "local database file" .mdf
What I would do now is create a database in a so called "remote server" (also if it is on the same computer), in other words, in my istance CASA of SQL Server Express.
Now l can do it only by SQL Server Management.
I know that VB Express can do it by code and not by drag-drop mode.
Thanks
markvanh