473,385 Members | 1,344 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,385 software developers and data experts.

Getting not declared Error

Can some take a look at this and tell me what I am doing wrong and how to
fix it. I an new to ASP.NET

Getting Name "GetMsAccessOldebConnection' is not declared " Error

<%@ Page language="VB" Debug="false" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">

public shared function GetMsAccessOledbConnection(ByVal dbPath As String,
ByVal dbID As String, ByVal dbPassword As String)
Dim dbConn As OleDbConnection
Dim dbConnStr As String =
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

Sub Page_Load(Sender as Object, E as EventArgs)
Dim oConn As OleDbConnection
Dim oComm As OleDbDataAdapter
Dim sConn As String
Dim sComm As String
Dim oDataSet As New DataSet
dim Pathdb as String
Pathdb = String.Format(server.mappath("reports/db/specialk.mdb"))

sComm = "Select LastName, FirstName, Phone FROM tblEmployeeChecklist
where ActiveStatus=" & "Yes"' & "'"

'Usually you would use error-handling here. It is left out to
'make the code as simple as possible.

'Create the connection and command objects
oConn = GetMsAccessOledbConnection(Pathdb, "admin", "")
oComm = New OleDbDataAdapter(sComm, oConn)

'Fill the dataset with the results of the query
oComm.Fill(oDataSet, "Employees")

'Set the grid source to the dataset and bind the data
oGrid.DataSource=oDataSet.Tables("Employees").Defa ultView
oGrid.DataBind()
End Sub
Mar 21 '06 #1
1 1046
You should probably start by changing your function declaration to:
public shared function GetMsAccessOledbConnection(ByVal dbPath As
String,
ByVal dbID As String, ByVal dbPassword As String) As OleDbConnection
otherwise it returns an object.

Mar 21 '06 #2

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

Similar topics

0
by: ReignMan | last post by:
I'm running JDK 1.4.0_01, Xalan2.5.1 and Tomcat 4.1.27. XSL transformations work, yet when running in debug mode (Eclipse IDE), I get the following: 990S2html.xsl:3:80: Element type...
7
by: bisforbenson | last post by:
I'm trying to compile things with gcc 4. After running the following command: % gcc -O3 -g -Wall -Wno-unused -DLINUX -D_REENTRANT -o ../../obj/egi.o -I../../include/ -I... -c egi.cpp i get...
1
by: Derek | last post by:
I am writing a web application for job seekers, and am adding a section that allows administrators to upload jobs to the system via xml. I have used an xml schema to validate the xml they upload....
0
by: vsaraog | last post by:
Hi y'all, I am using a Created Global Temporary Table in DB2 OS/390 version 7.1.2. I am inserting some data in it and then updating the table using ODBC but while I try to update it, I am...
1
by: Bimal | last post by:
Hi, I upgraded my gcc from 2.95 to 3.3. When I compile some projects I get error messages saying... /usr/local/include/c++/3.3/ctime:68: error: `tm' not declared...
3
by: Deepson Thomas | last post by:
The below is error message : The type 'page2' already contains a definition for 'txtLocationName' i know why this comes. but iam not ablke to find the other place where the definition is added....
9
by: Brian | last post by:
So I have this: double x = .25; double y = .5; double z = .25; double probability; int index; while(index < 30) {
15
by: ssylee | last post by:
I am using mikroC to program some microcontroller code in C. However I have come across of potential problem of bool type not being supported from the compiler complaint on how I declared type bool...
5
by: atulpatil09 | last post by:
when I am trying to compile the below code I am getting error as below, Could you please let me know how to solve the above compilation error for the below program snippet MList<MRvDispatcher...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.