connecting ms access db

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Connecting to an MS Access DB over WEBDAV in excel | Excel forum

Connecting to an MS Access DB over WEBDAV in excel | Excel forum

resolvedResolved · Urgent Priority · Version 2003

Rob has attended:
Excel VBA Advanced course

Connecting to an MS Access DB over WEBDAV in excel

Hi Steven,

I'm trying to access a MS Access database which I have saved on a WEBDAV (internet hosted server), by using the same kind of code we used during the training in Aug. Here is an example of me proposed script
__________________________________________
Sub SourceDataProd()

Const CString As String = _
"Provider=MS Remote;Remote Server=https://rob7208.dailydrive.co.uk/dav;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ConscienceSandpit\ProviderKey\DBTest.mdb;Persist Security Info=False"

Const SQL As String = _
"SELECT URN, Contact, Company, ContactTel FROM TestTable1"

Dim cnConnection As ADODB.Connection
Dim rstRecordset As ADODB.Recordset

Set cnConnection = New ADODB.Connection
cnConnection.ConnectionString = CString

cnConnection.Open

Set rstRecordset = New ADODB.Recordset

Call rstRecordset.Open(SQL, cnConnection)

With rstRecordset

If .BOF And .EOF Then
MsgBox "There are no records"
Exit Sub
End If

.MoveFirst

Call ClearCollection

Do While Not .EOF

Set aDataProd = New SourceDataProd

aDataProd.dbURN = .Fields("URN")
aDataProd.dbContact = .Fields("Contact")
aDataProd.dbCompany = .Fields("Company")
aDataProd.dbTel = .Fields("ContactTel")

Call theDataProd.Add(aDataProd)

.MoveNext

Loop

End With

cnConnection.Close

End Sub
_______________________-

I'm not getting anywhere with this as the report gets stuck at Call rstRecordset.Open(SQL, cnConnection).

However, I'm not if this is related to the problem but when I saved the Access mdb file in the WEBDAV file and then tried to open it from that location I get a message which reads...
"Microsoft Access is unable to load the data access page; The file you attempted to load was not recognised as HTML; You may have selected the wrong file, or tried to open a database file off of a web server"

When I usually access this WEBDAV file I have to provide a username and password, so I'm not sure if this is what is creating the problem...can you help?

CHEERS

ROB

RE: Connecting to an MS Access DB over WEBDAV in excel

Hi Rob

Thank you for your question

This is very hard to fathom without having both the workbook and the database to work with.

We need to eliminate the obvious possibilities first.

So, you mention that you have to enter a passowrd to access the database. I am assuming you used a UDL to create your connection string.

On the connection tab, enter your user name and password, and then use the resulting connection string.

This may possibly solve the problem. If not, then let me know and we will try something else

Regards

Stephen

RE: Connecting to an MS Access DB over WEBDAV in excel

Hi,

This question has now been left unattended for a while.

We like to keep down the large number of active forum posts we receive.

As we are waiting for your response for further information to help resolve your issue, we will be automatically marking this question as resolved in the next 5 days (unless you post a follow-up within that time).

We look forward to hearing from you.

Thank you.
Regards, Rich

RE: Connecting to an MS Access DB over WEBDAV in excel

I have supplied as much information as possible to resolve this issue, it is simply about whether it is possible to use connect to an access database table using ADO/DAO held on a webserver....

Don't worry I'm trying to sort this out myself.

Cheers

Rob

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Applying and removing border from cell in Excel 2010

Did you know the shortcut key for applying and removing the outline border for a cell?

CTRL+SHIFT+& Applies the outline border to the selected cells.
CTRL+SHIFT_ Removes the outline border from the selected cells.

View all Excel hints and tips


Server loaded in 0.11 secs.