473,404 Members | 2,178 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,404 software developers and data experts.

Database connectivity with MS Access in Microsoft Visual Studio .NET

Hi All,

I am developing a intra-company website. I am working in MS Visual
Studio .NET, and am writing the code in VBScript.

I have an MS Access database with which i want to connect. Once the
connection is established, i want to retreive a particular record and
display one particular field of the record in a text box.

Given below is the concerned code snippet (the default.aspx.vb file):
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Submit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Submit.Click
Dim Conn
Dim rsAddRequest
Dim val

Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.Open(Server.MapPath("requests.mdb"))
rsAddRequest = Server.CreateObject("ADODB.Recordset")

rsAddRequest.CursorType = 2
rsAddRequest.LockType = 3

rsAddRequest.Open("Select * from request where
TrackingID='RR0004'", Conn)

Name.Text = rsAddRequest.Fields("RequesterName").ToString()

rsAddRequest.Close()
rsAddRequest = Nothing
Conn = Nothing
End Sub
End Class
The database is requests.mdb; the table is request, the field to be
displayed is RequesterName and the text boc is named Name.

The code given above diplays "System.__ComObject" in the text box.

And, if i remove the .ToString() part, then the error generated is
"Conversion from type 'Field' to type 'String' is not valid."

Please help me out as i am unable to figure where i am going wrong and
what is the solution. Please reply ASAP.

Thanks.

Feb 8 '06 #1
1 1847
ab********@gmail.com wrote in
news:11**********************@f14g2000cwb.googlegr oups.com:
I am developing a intra-company website. I am working in MS Visual
Studio .NET, and am writing the code in VBScript.

I have an MS Access database with which i want to connect


No, you have a Jet database that, perhaps, you created in MS Access.

Access is not involved -- only Jet. Jet and Access are two different
things. Learn the difference.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Feb 8 '06 #2

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

Similar topics

3
by: Krish | last post by:
Hi Friends, Does anyone know how to connect access database into Visual C++ in Visual Studio 6.0. I know the procedure to connect access database into Visual Studio .Net. But Visual Studio 6.0...
1
by: pw | last post by:
Hi, I can't find anything about a toolkit on Microsoft site or what is needed to distribute an Access 2003 application (like the SDK w/ Access 97). I assume this is still possible. What do I...
15
by: philip | last post by:
On a form, I have a datagridview. This datagridview is constructed on a dataset filled by a tableadapter. The table adapter do very well what it must do when filling dataset. Insertions,...
4
by: bh | last post by:
I have an ASP.NET page, created in VS.NET 2003 which connects to a SQL Server 2000 Database on our network, using a connection string, as follows: Dim SQLConnString As String = "data...
0
by: Jonathan Wood | last post by:
I seem to be having errors creating and accessing an SQL database. Unfortunatley, I am brand new to SQL setup and administration issues so this really is not my area of expertise. I know I had...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
47
by: Ivan Weiss | last post by:
Hi all, I am just getting started on a new app and am a rusty VB6 guy who is looking to create something on the side to serve as a corporate workbench for my company. ADO.net is new to me so...
4
by: Cindy H | last post by:
Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great...
6
by: praveenb000 | last post by:
we hosted a website http://vijayawadanalanda.org developed using asp.net and back end MS Accees database. There is some database connectivity problem occurring when saving the information in...
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.