473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

End of statement expected error

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;Da ta
Source={0};User ID={1};Password={2}", dbPath, dbID, dbPassword);
return new OleDbConnection(dbConnStr);
End function
Mar 20 '06 #1
2 1650
VB/VB.NET does not use ";" to end a line of code.

"momo" <ma***@seeourweb.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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;Da ta
Source={0};User ID={1};Password={2}", dbPath, dbID, dbPassword);
return new OleDbConnection(dbConnStr);
End function

Mar 20 '06 #2
On Mon, 20 Mar 2006 16:56:02 -0500, momo wrote:
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;Da ta
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....
Mar 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
Here is the function ArraySearch: '-------------------------------------------------------------------------------------- 'ArraySearch will return an integer value indicating the first...
7
by: Graham James Campbell CS2000 | last post by:
Having a nightmare problem with this and would appreciate any and all help. The situation is I want to move from a webform and format the user inputted text into some html I am storing in a...
6
by: Oli | last post by:
Hi, Im trying to use a sesson statement within an SQL Statement: sql = "SELECT * FROM tblNumbers WHERE AllocatedTo=" & Session("Company") & "" And get the error: Error Type:
3
by: Matt | last post by:
When the ASP statement end with a _ character, then the next line cannot have comment ' character. Is that correct? Since I encountered the following error: Microsoft VBScript compilation...
2
by: Edward S | last post by:
I would appreciate if someone could correct my SQL statement which is displaying a message Expected : End of Statement this statment is attached to a button on the form StrSQL = "PARAMETERS !!...
3
by: NeilH | last post by:
Hello All I was wondering if someone could offer a rather inexperienced person some advice. Im trying to get my asp page to look at an access data I created the following query in access...
35
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is...
3
by: DracoZA | last post by:
Can anyone tell me where the problem is here ? - Thanks Error: Microsoft VBScript compilation error '800a0401' Expected end of statement /test/ADO/demo_add.asp, line 15
1
by: nosaj070 | last post by:
Hi, I'm working on a project and it is my first time implementing VBA with Access. I know my SQL Statement is close, but it obviously isn't perfect, if any of you can see what the error is I'd really...
3
by: Indy | last post by:
Hi, I am new to VB and have some previous programming experiences. Curently working as an IT support person and trying to write a VB 6 script to access apos database and get one of the table's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.