none
VB 2008 & Access application works on client, fails on network, with "Format of the initialization string does not conform to specification starting at index ,,," RRS feed

  • Question

  • We have a VB2008(Express) program that interacts with an MS Access(2007) database.  Works fine on any given PC; but when we move the database onto the (Windows) network, we get the message "Format of the initialization string does not conform to specification starting at index ..."  (The connection string is modified to point to the network location, by prompting the user with a file-open dialog, to find the new location of the database.   The result of the file-open prompt is a FileName (string) which, on the client, is something like "C:\So-and-so\Mystuff.mdb", and when it's on a mapped drive on the network, it may be "X:\so-and-so\MyStuff.mdb".  In either case, I insert that into the old connection string -- NewCxStr = OldCxStr.Replace(OldCxStr.DataSource, DIalog.FileName) -- and it works great.  (I can even save it as My.Settings so as not to prompt for it again unless it's moved again.)

    If the net drive is NOT mapped, though, the FileName would look somewhat different; I wonder if that would result in the nonconforming initialization string.  Any thoughts?

    Much obliged,

    Stephen


    J. S. Schiavo, Missouri Southern State University
    Tuesday, August 2, 2011 11:19 PM

Answers

  • Hi Stephen,

    Welcome!

    I think it relates the connection string:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;

    The more information you can refer here: http://www.connectionstrings.com/

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 3, 2011 10:43 AM
    Moderator
  • If the path to the database is invalid or unavailable, then it most definitely could cause the exception you mention. For any database file path which involves mapping a drive letter to a network resource, the drive letter would need to be mapped prior to opening a connection to the database.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, August 3, 2011 12:50 PM

All replies

  • Hi Stephen,

    Welcome!

    I think it relates the connection string:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;

    The more information you can refer here: http://www.connectionstrings.com/

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 3, 2011 10:43 AM
    Moderator
  • If the path to the database is invalid or unavailable, then it most definitely could cause the exception you mention. For any database file path which involves mapping a drive letter to a network resource, the drive letter would need to be mapped prior to opening a connection to the database.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, August 3, 2011 12:50 PM
  • Hi,

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance. 

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 11, 2011 8:29 AM
    Moderator