Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE DB /ODBC Problem (Urgent)..Help Please
Message
De
21/03/2002 02:22:35
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
OLE DB /ODBC Problem (Urgent)..Help Please
Divers
Thread ID:
00635348
Message ID:
00635348
Vues:
56
Hi,

I am using VB6 with SQL Server7. If I am using ODBC my program working perfectly. Below code using to connect through ODBC....
Set con = New ADODB.Connection
con.CursorLocation = adUseClient
con.ConnectionString = "DSN=VBSQLHRM;user id=sa;password=;"
con.Open

rs.CursorLocation = adUseClient
rs.Open "select * from emp", con, adOpenDynamic, adLockOptimistic, adCmdText
rs.AddNew
Text1.SetFocus
If I am using Connectiog provider SQL OLEDB like this...than getting error
Set con = New ADODB.Connection
con.CursorLocation = adUseClient

con.Provider = "SQLOLEDB"
con.ConnectionString = "user id=sa;password=;data source=hrbo;initial catalog=Hrpay"
con.Open

rs.CursorLocation = adUseClient
rs.Open "select * from emp where empid=0", con, adOpenDynamic, adLockOptimistic, adCmdText
rs.AddNew
TxtEmpID.SetFocus
when using this OLEDB than getting following error..
Runtime error -2147467259
[DBNETLIB][Connection open(connect())] SQL Server does not exist or access denied.

I am unable to understand I am using both place loging ID sa so there is no question of access denied. Other, SQL server doesnot exist how its possible since connecting through ODBC. If I am testing through ODBC its also showing Tested sussesfully.
I dont want to go through ODBC since in this case I have to configure all client machine and also I have to take care whenever machine format/chage. Thatswhy I want to go through OLEDB provider.
YOur Detail Guide will be highly appreciated.

Best regards,
Sajjad Ahmad
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform