//Profile
The SQLCA. DBMS="SNC SQL Native Client (OLE DB)"
The SQLCA. LogPass=& lt; * * * * * * * * * * * * * * * * * & gt;//please modify into their passwords
The SQLCA. ServerName="server"
The SQLCA. LogId="sa"
The SQLCA. The AutoCommit=False
='MyDatabase' SQLCA. DBParm="Database, ProviderString='Database=MyDatabase'"
If the sqlca. Sqlcode=0 then
Open (w_test)
The Else
Messagebox (" connect to the database ", "connect to database failure! ')
End the if
Method 2:
//Profile
The SQLCA. DBMS="OLE DB"
The SQLCA. LogPass=& lt; * * * * * * * * * * * * * * * * * & gt;//please modify into their passwords
The SQLCA. LogId="sa"
The SQLCA. The AutoCommit=False
The SQLCA. DBParm="PROVIDERSTRING='database=Mydatabase', the PROVIDER='SQLOLEDB', the DATASOURCE='server'"
If the sqlca. Sqlcode=0 then
Open (w_test)
The Else
Messagebox (" connect to the database ", "connect to database failure! ')
End the if
These two kinds of connection methods can be used, PB12.5 version no longer supported directly connected ms SQL server.
For beginners reference PB friend!
CodePudding user response:
Received.