Link to home
Start Free TrialLog in
Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla

asked on

SQL 8 with vb6 network connection

Hi experts, I'm having difficulties in connecting database with sql 8 to a network or other pc. Codes below is working locally but when i try to run it via network an error occur,  says; " Server does not exist" . Im using OS Widows 10. Thanks!

Sub eMiles(edate, db As String, rmrk As String)
        Dim e As Save_Files
        Set e = New Save_Files
        e.OPEN_CON db, "SkyJob" & "\SQLEXPRESS"
            e.RecordHistory edate, rmrk
        e.CLOSE_CON
end sub

Open in new window


Public Sub OPEN_CON(db As String, ServerName As String)
Set cn = New ADODB.Connection
cn.Provider = "sqloledb"
cn.ConnectionTimeout = 12
cn.Properties("Data source").Value = Trim(ServerName)
cn.Properties("Initial Catalog").Value = Trim(db)
cn.Properties("User ID").Value = "sa"
cn.Properties("Password").Value = "100"
cn.CursorLocation = adUseClient
cn.Open , "sa", ""

If Err.Number <> 0 Then
    MsgBox (Err.Number & "|" & Err.Description)
End If

End Sub

Open in new window

SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Whing Dela Cruz

ASKER

Hi experts, All connections looks good. I tried to switch of all firewall and anti-virus in my pc but I've got the same result.  According to ste5an
 You need to configure it for that
Is there anyone who can guide me that... Thank you!
Thank you guys for the idea you have provided in the issue. I was able to run thru configuring the Sql server configuration manager. Thanks you both and may God bless you!