End of statement expected error

M

momo

Help please
I am getting this error: BC30205: End of statement expected.

Here is the code:

public shared function GetMsAccessOledbConnection(ByVal dbPath As String,
ByVal dbID As String, ByVal dbPassword As String)
Dim dbConn As OleDbConnection
Dim dbConnStr As String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source={0};User ID={1};Password={2}", dbPath, dbID, dbPassword);
return new OleDbConnection(dbConnStr);
End function
 
E

Erik Funkenbusch

Help please
I am getting this error: BC30205: End of statement expected.

Here is the code:

public shared function GetMsAccessOledbConnection(ByVal dbPath As String,
ByVal dbID As String, ByVal dbPassword As String)
Dim dbConn As OleDbConnection
Dim dbConnStr As String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source={0};User ID={1};Password={2}", dbPath, dbID, dbPassword);
return new OleDbConnection(dbConnStr);
End function

Several major problems with that code.

First, your fucntion doesn't define a return value type.

Second, the code your using for dbConnStr is invalid. You have to say:

Dim dbConnStr As String = String.Format....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top