0

Hello,

Does anybody know of a tutorial on download specific data from a web server sql db and inserting this into a local access db?

5
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by Alekhan
Featured Replies
  • Option Explicit Dim adoConn As ADODB.Connection Dim adoRst As ADODB.Recordset Private Sub Command1_Click()'============================ Dim strConString As String Dim strSQL As String 'assign connection string strConString = "Provider=MS Remote;" & _ "Remote Server=http://192.168.1.1;" & _ "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=MyRemoteDB;Persist Security Info=False" 'initialize connection object variable Set adoConn = New … Read More

0

Start of one bit at a time.

-First find out how to open a web page and download something to your pc
-Then try to create an sql database
-Then try to insert something into the database
-Then try to combine it altogether

1

Option Explicit
Dim adoConn As ADODB.Connection
Dim adoRst As ADODB.Recordset

Private Sub Command1_Click()'============================
Dim strConString As String
Dim strSQL As String
'assign connection string
strConString = "Provider=MS Remote;" & _
"Remote Server=http://192.168.1.1;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=MyRemoteDB;Persist Security Info=False"
'initialize connection object variable
Set adoConn = New ADODB.Connection
'open connection
adoConn.Open strConString, "admin", ""
strSQL = "Select * from Orders"
'initialize recordset object variable
Set adoRst = New ADODB.Recordset
With adoRst
.Open strSQL, adoConn, , , adCmdText
If Not .EOF Then
Do While Not .EOF
'read each record here
'...
.MoveNext
Loop
.Close
End If
End With

'destroy recordset object if necessary (or do it when you unload the form)
'Set adoRst = Nothing
'destroy connection object if necessary (or do it when you unload the form)
'Set adoConn = Nothing
End Sub Option Explicit
Dim adoConn As ADODB.Connection
Dim adoRst As ADODB.Recordset

Private Sub Command1_Click()'============================
Dim strConString As String
Dim strSQL As String
'assign connection string
strConString = "Provider=MS Remote;" & _
"Remote Server=http://192.168.1.1;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=MyRemoteDB;Persist Security Info=False"
'initialize connection object variable
Set adoConn = New ADODB.Connection
'open connection
adoConn.Open strConString, "admin", ""
strSQL = "Select * from Orders"
'initialize recordset object variable
Set adoRst = New ADODB.Recordset
With adoRst
.Open strSQL, adoConn, , , adCmdText
If Not .EOF Then
Do While Not .EOF
'read each record here
'...
.MoveNext
Loop
.Close
End If
End With

'destroy recordset object if necessary (or do it when you unload the form)
'Set adoRst = Nothing
'destroy connection object if necessary (or do it when you unload the form)
'Set adoConn = Nothing
End Sub

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.