How can I connect to a database with this DAMN VB.NET to a database that is on another computer ???
Always get that the path is invalid (which is not) or that I do not have the permission (which I have) !!!
Anyone can help me ???
Printable View
How can I connect to a database with this DAMN VB.NET to a database that is on another computer ???
Always get that the path is invalid (which is not) or that I do not have the permission (which I have) !!!
Anyone can help me ???
Describe more about these DAMNs ! :P
Always get that the path is invalid (which is not) or that I do not have the permission (which I have) !!!
DUH !!!
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
Dim myReader As OleDbDataReader
'Use a variable to hold the ConnectionString.
Dim myConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
" Data Source=Y:\GestionsWeb\CPFMTCompteur\CPFMTCompteur.mdb"
'Create an OleDbConnection object,
'and pass in the ConnectionString to the constructor.
myConnection = New OleDbConnection(myConnectionString)
'Open the connection.
myConnection.Open()
bugging after that
see if this format helps:
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\myServer\myShare\myPath\myDb.mdb"
Nop, didn't work either ...
What error are you getting?
Also what did you change when it went from the path error to the permissions error?
Try building the connection string with the IDE in the server explorer and then cut and paste it into your code.
I've try with the Server Explorer and when I test with it, its working but when I paste the connection string in my code, then isn't working anymore :S
that's the error that I receive :
The Microsoft Jet database engine cannot open the file '\\Cpf-mtl-data\Data\Developpeurs\CPFMTLienDB\CPFMTLienDB.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
Do you have 'write' permission on that folder so it can place the lcok file on it?
Try closing the connection that is open in the Server Explorer.
Closing the connection in server explorer shoudn't make any difference as it has never made such an error when i work with my application while the connection in open in the explorer.
that's true, it doesn't make any difference
It has for me before. Not usually but I have had the server explorer open the db exclusively and then I was blocked during the application. I assume it is some sort of bug in the IDE or something, but it has only happen to me once or twice.
still i think you need 'write' permission on that network share.
Try opening the file over the network (outside of VB).
Openning the DB outside VB works perfectly, and even in the Server Explorer so I don't understand why its simply don't work in my code ....
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
Dim myReader As OleDbDataReader
'Use a variable to hold the ConnectionString.
Dim myConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\Cpf-mtl-data\Data\Developpeurs\CPFMTLienDB\CPFMTLienDB.mdb"
'Create an OleDbConnection object,
'and pass in the ConnectionString to the constructor.
myConnection = New OleDbConnection(myConnectionString)
'Open the connection.
myConnection.Open() // Bug here !!!
By the way, its an Access 97 DB