I am using a centralized data base on an FTP server that I need to form a connection to from excel to write, update, and pull data. Thus far I can get this to work when the data base in on my local computer, but once it's on the server I can't open the connection with a macro.
The following is my existing code:
I have tried to reference the network drive directly
"ftp://ftp.myserver.com/Myfolder/..."
but still no luck, I'm sure it's something simple (as is usually the case for my projects).
Any help in this is greatly appreciated,
Thanks in advance
--It's only hard until you know it, then it's easy...
The following is my existing code:
Code:
Sub Button2_Click()
'''test button for adding a new line to access data base
'''this code should be pasted into UFinput/CBSubmit_click() sub when completed
'declare all dementions
Dim cn As New ADODB.Connection, rs As New ADODB.Recordset
'open connection and table in data base
cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data " _
& "Source=NWdrive/Myfolder/Myfile.accdb;Persist " _
& "Security Info=False;"
rs.Open "TblMCIssues", cn, adOpenKeyset, adLockOptimistic
'write data to access data base
With rs
.AddNew
.Fields("Date Reported") = Now()
.Fields("Location") = "User Defined"
.Fields("Description") = "User Defined"
.Fields("Equipment") = "User Defined"
.update
End With
'close connection when all work is completed
rs.Clone
cn.Close
'line to be deleted/altered when coding completed
MsgBox "This code has run successfully", vbOKOnly, "Testing"
End Sub
I have tried to reference the network drive directly
"ftp://ftp.myserver.com/Myfolder/..."
but still no luck, I'm sure it's something simple (as is usually the case for my projects).
Any help in this is greatly appreciated,
Thanks in advance
--It's only hard until you know it, then it's easy...