Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE DB /ODBC Problem (Urgent)..Help Please
Message
 
À
21/03/2002 02:22:35
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00635348
Message ID:
00635421
Vues:
27
Are you using Windows authentication? in this case use:
con.ConnectionString = "Provider=SQLOLEDB;Integrated security=SSPI;data source=hrbo;initial catalog=Hrpay"
con.Open
>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,
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform