Domanda

by default MS access connection string is

connection = "Driver={Microsoft Access Driver (*.mdb)};" & _
    "dbq=Database1.mdb;" & _
    "DefaultDir=E:\somepath;" & _
    "uid=Admin;Pwd=;"

and i want use label to get database path info

connection = "Driver={Microsoft Access Driver (*.mdb)};" & _
    Chr(34) & "dbq=" & lblF.Caption & ";" & Chr(34) & _
    Chr(34) & "DefaultDir=" & LocL.Caption & ";" & Chr(34) & _
    "uid=Admin;Pwd=;"

but it's fail :(

Nessuna soluzione corretta

Altri suggerimenti

Remove all the Chr() calls. You don't need to insert any double quotes in this connection string.

i.e.

connection = "Driver={Microsoft Access Driver (*.mdb)};" & _
             "dbq=" & lblF.Caption & ";" & _
             "DefaultDir=" & LocL.Caption & ";" & _
             "uid=Admin;Pwd=;"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top