Results 1 to 16 of 16

Thread: MS Access and VB.NET

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    89

    MS Access and VB.NET

    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 ???
    BlahDoS . :P

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Describe more about these DAMNs ! :P

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    89
    Always get that the path is invalid (which is not) or that I do not have the permission (which I have) !!!


    DUH !!!
    BlahDoS . :P

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    89
    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
    BlahDoS . :P

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    see if this format helps:
    oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=\\myServer\myShare\myPath\myDb.mdb"

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    89
    Nop, didn't work either ...
    BlahDoS . :P

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    89
    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.
    BlahDoS . :P

  9. #9
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Do you have 'write' permission on that folder so it can place the lcok file on it?

  10. #10
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Try closing the connection that is open in the Server Explorer.

  11. #11
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    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.

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    89
    that's true, it doesn't make any difference
    BlahDoS . :P

  13. #13
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  14. #14
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    still i think you need 'write' permission on that network share.

  15. #15
    New Member
    Join Date
    Dec 2002
    Location
    USA
    Posts
    10
    Try opening the file over the network (outside of VB).

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    89
    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
    BlahDoS . :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width