1 year ago
#374266
HanSol23
VB.NET - Format of the initialization string does not conform to specification starting at index 34
Dim path As String = xlPath
Dim conString = String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + path + "';Extended Properties='Excel 8.0;HDR=No;IMEX=1;TypeGuessRows=0;MaxScanRows=0;ImportMixedTypes=Text';")
Dim cmd As New OleDb.OleDbCommand
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim dtset As DataSet
MyConnection = New System.Data.OleDb.OleDbConnection(conString)
cmd.Connection = MyConnection
cmd.CommandType = CommandType.Text
cmd.CommandText = query
Dim MyCommand As New System.Data.OleDb.OleDbDataAdapter(cmd)
dtset = New System.Data.DataSet
MyCommand.Fill(dtset)
Dim dtb As DataTable = dtset.Tables(0)
I Have a connection string in VB.NET which works fine for me as well as other bunch of users. But there is one user who is getting this error "Format of the initialization string does not conform to specification starting at index 34"
When i checked the character at Index 34 its the end of Provider "Provider=Microsoft.ACE.OLEDB.12.0". Is there any problem with the code or is there something missing in the Users system?
c#
excel
vb.net
oledb
oledbconnection
0 Answers
Your Answer