S
Spiros
Dear All,
I wrote VBA code in Access 2003 for a project...I have for a PDA...and
therefore it is required to access SQL Server Compact 3.5
Following that I came up with a problem though which I cannot find an aswer
for. In debugging mode when the line pConn.Open reached it produces the
following error:
(We suspect that there is a problem with the OLEDB provider...)
"Run-time error -2147467259 (800004005)
Method "Open" of object '_Connection' failed.
Any ideas of what it may be...?
....(For the purpose of testing I used the following code)...
Sub SyncStockItems()
Dim pConn As ADODB.Connection
Dim pRs As ADODB.Recordset
Set pConn = New ADODB.Connection
Set pRs = New ADODB.Recordset
pConn.ConnectionString = "PROVIDER=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data
Source=C:\Apog\Apog.sdf"
-----'pConn.ConnectionString =
"PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=C:\Apog\Apog.sdf"
If pConn.State = 1 Then
pConn.Close
End If
pConn.Open
'Delete All Records from Mobile Database
pConn.Execute "DELETE * FROM StockItems"
'pRs.Open
pRs.Close
pConn.Close
Set pRs = Nothing
Set pConn = Nothing
In terms of the project I will first explain that I started by trying to
"connect" the Access database with the SQL Server Compact Edition since it is
a task that is crucial for the users of the project. So I wrote the code
supplied in Access 2003 (VBA editor) and from there I got the error message
in question. The next stage would be to write Visual Basic code in Visual
Studio 2005 that it would run on the PDA (using the data copied from Access
on the SQL Server Compact database) for collecting data and then transfer the
data to Microsoft Access for further manipulation...
Thank you in advance...
Spiros..
I wrote VBA code in Access 2003 for a project...I have for a PDA...and
therefore it is required to access SQL Server Compact 3.5
Following that I came up with a problem though which I cannot find an aswer
for. In debugging mode when the line pConn.Open reached it produces the
following error:
(We suspect that there is a problem with the OLEDB provider...)
"Run-time error -2147467259 (800004005)
Method "Open" of object '_Connection' failed.
Any ideas of what it may be...?
....(For the purpose of testing I used the following code)...
Sub SyncStockItems()
Dim pConn As ADODB.Connection
Dim pRs As ADODB.Recordset
Set pConn = New ADODB.Connection
Set pRs = New ADODB.Recordset
pConn.ConnectionString = "PROVIDER=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data
Source=C:\Apog\Apog.sdf"
-----'pConn.ConnectionString =
"PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=C:\Apog\Apog.sdf"
If pConn.State = 1 Then
pConn.Close
End If
pConn.Open
'Delete All Records from Mobile Database
pConn.Execute "DELETE * FROM StockItems"
'pRs.Open
pRs.Close
pConn.Close
Set pRs = Nothing
Set pConn = Nothing
In terms of the project I will first explain that I started by trying to
"connect" the Access database with the SQL Server Compact Edition since it is
a task that is crucial for the users of the project. So I wrote the code
supplied in Access 2003 (VBA editor) and from there I got the error message
in question. The next stage would be to write Visual Basic code in Visual
Studio 2005 that it would run on the PDA (using the data copied from Access
on the SQL Server Compact database) for collecting data and then transfer the
data to Microsoft Access for further manipulation...
Thank you in advance...
Spiros..