|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Cannot Use database located on a web server in VB
hello!
i am trying to use an external database (located on a web server) using the code below, but i am getting an Error "Not a valid filename". What is wrong? Public Function ExecuteSQL(ByVal SQL _ As String, MsgString As String) _ As ADODB.Recordset 'executes SQL and returns Recordset Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset Public Function ConnectString() _ As String 'returns a DB ConnectString ConnectString = "Provider=" & _ "Microsoft.Jet.OLEDB." & _ "4.0;Data Source=" & _ App.Path & "http://169.254.186.1/Registration/database.mdb" End Function Thanks a lot |
|
#2
|
||||
|
||||
|
You can't do it that way...You would have to use one of the connectionstrings below
The following connections strings use Microsoft's remote provider (MS Remote). The MS Remote provider tells ADO to communicate with the remote server (via the RDS DataFactory) and to use the remote provider that is installed on the remote server. WARNING: RDS is considered obsolete by Microsoft WARNING: The RDS DataFactory can be a major security hole if not setup and configured correctly! For more information, see RDS FAQ #24 Code:
If you want to use an ODBC DSN on the remote machine
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=MSDASQL;" & _
"DSN=AdvWorks;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
If you want to use an OLE DB Provider on the remote machine
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb", _
"admin", ""
If you want to use an OLE DB Provider on the remote machine
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Handler=MSDFMAP.Handler;" & _
"Data Source=MyAdvworksConn"
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Cannot Use database located on a web server in VB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|