Connection to a web server
Hi group,
I have question regarding a Client/Server application that uses IIS and Remote Data Services.
(If anybody is interested I can send the demo so just let me know.)
The application is diveded in 2 projects a DLL and a normal EXE (the application) The DLL needs to be registered on the Server.
The other (the exe or .VBP) is the client. The client's computername is identified with this line:
Set objProxy = dsDataSpace.CreateObject _
("prjServer.clsServer", "HTTP://ehvwks67") 'HTTP://MyComputerName
To connect the client to the database it calls the function below. This function is part of the DLL. How the f##k does the client know where this DLL is located AND where to find the database?!?!
Is it possible to change th ConnectionString to something like:
.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=HTTP://111.111.11.111\nwind.mdb;" & _
"Uid=" & UserID & ";Pwd=" & Password
Please advise.
Regards,
VisualSander
Public Function MakeConnection(Optional UserID As String, _
Optional Password As String) As String
' Create the connection object.
Set cn = New ADODB.Connection
'On Error GoTo ConnectErr
With cn
.CursorLocation = adUseClient
' If the DBMS demands a user name and password,
' use the optional arguments and create an
' appropriate ConnectionString that incorporates
' the values. For the sake of simplicity,
' the Northwind DBMS isn't protected.
.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=C:\Program Files\Microsoft Visual Studio\VB98\nwind.mdb;" & _
"Uid=" & UserID & ";Pwd=" & Password
'.ConnectionString = "DSN=Northwind"
.Open
End With
' Assuming no errors occurred.
MakeConnection = True
Exit Function
' When errors occur, trap them below.
ConnectErr:
Dim i As Integer
Dim sErrors As String
sErrors = Err.Number & ": " & Err.Description
If cn.Errors.Count > 0 Then
For i = 0 To cn.Errors.Count - 1
' Handle errors here.
sErrors = sErrors & cn.Errors(i).Number & _
": " & cn.Errors(i).Description & vbCrLf
Next i
End If
MakeConnection = sErrors
Exit Function
End Function