Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Reference to a non-shared member requires an object reference.

Status
Not open for further replies.

Everton1Blue

Technical User
Jun 6, 2014
41
GB
Hello

I am trying to create a log-in page (MS Access) for the first time, and I am getting this error (among others!):

Visual Studio said:
Dim conn As New OleDbConnection(ConnectionString)

Compilation Error: BC30469: Reference to a non-shared member requires an object reference.

The error (blue underline) specifically refers to 'ConnectionString'.

Aren't I saying that OleDbConnection = ConnectionString, and isn't that correct?

Thanks!

 
...and you resolved it how?

Other members who browse these forums want to know how you resolved your issue(s). Tek-Tips is not a one-way street. We ask questions and share solutions.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
The problem was not 'ConnectionString' as such, but the line above it. The error disappeared when I used:

Code:
Dim ConnectionString As String = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=|DataDirectory|students.mdb;"

        Dim conn As New OleDbConnection(ConnectionString)

That is, I had not declared 'ConnectionString'
Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top