Accessing a MS Access database

Hi, I would like to do a lookup into an Access database, and display the result in a grid.

I'm an embedded programmer being thrown into the world of .net, asp, VB, and databases so I don't know where to start :-) ...... can anyone help me ?
Thanks.
0
Nazdreg
8/26/2003 1:46:28 PM
asp.net.dotnetnuke 25171 articles. 0 followers. Follow

4 Replies
1097 Views

Similar Articles

[PageSpeed] 29

Really jus ta matter of making a connection, doing your query, and displaying results.

Here is a sample from a module I use.
The data is bound to a datagrid.
        Sub LoadSchedule()

Dim strSrc As String = CType(Settings("src"), String)
If Trim(strSrc) <> "" Then
OleDbComm.CommandText = "SELECT * from Schedule Where Week = " & cboWeek.SelectedValue
OleDbComm.Connection = Me.OleDbConn
Dim Reader As System.Data.OleDb.OleDbDataReader
OleDbConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=" & strSrc & ";Mode=Share Deny No" & _
"ne;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path=""" & _
""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=4;Jet OLEDB:Database Lock" & _
"ing Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transaction" & _
"s=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Je" & _
"t OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet " & _
"OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"
OleDbConn.Open()
Reader = OleDbComm.ExecuteReader()
dg.DataSource = Reader
dg.DataBind()
Reader.Close()
OleDbConn.Close()
End If
End Sub
0
s2k
8/26/2003 2:32:36 PM
Thanks a lot, I will try it out as soon as I have a chance.

Thanks again.
0
Nazdreg
8/28/2003 6:05:58 AM
I need to use an ODBC System DSN, and I thought of writing the code like this:


Dim dbCon As New SqlConnection()
dbCon.ConnectionString = "Something_that_points_to_my_DSN"
sbCon.Open()

I can't find any help on how to get the ConnectionString right, can anyone help me ?
Thanks
0
Nazdreg
9/3/2003 8:06:09 AM
You should use OleDb rather than ODBC.
Shaun Walker
Perpetual Motion Interactive Systems Inc.
http://www.dotnetnuke.com
DotNetNuke on SourceForge.Net
0
sbwalker
9/3/2003 9:20:40 PM
Reply:

Similar Artilces:

accessing MS Access from .net
hi I am accessing ms access data base which has a table called customers. when i try to insert data into the table i am gettign the error like "Operation must use an updatable query" and the line its showing is myOleDbcommand.ExecuteNonQuery() here is my code in page lode event Sub Page_Load(Sender As Object, E As EventArgs) Dim StrConnectString as String Dim strStatement as String strConnectSTring = "Provider=Microsoft.Jet.OLEDB.4.0;Password='';User ID=Admin;Data Source=C:\Inetpub\wwwroot\Srinu\WebApplication2\...

How to Access a MS Access Database in a webserver
i, I have a database that is located outside of root. /database /myzone /clients /test /WebAPPTest4/default.aspx I was given following code by my host but I couldnt get it work. ****************************************************** Private Sub Connection() Dim strPath = Server.MapPath("/") Dim strPathDatabase = Replace(strPath, "\www", "\database") Dim strConnection = strPathDatabase & "\RecordLabel.mdb" Dim sConnectionString As New String("Provider=Microsof...

Synchronise access to ms access database
Hello guys, i'm currently working on an asp.net application that connects to an access database. What I am noticing in the developement process is that whenever i'm opening the database using MS access and trying to execute a function in my project that needs to access the database, i get an error "couldn't open file". Well, the solution is to close the database in MS access so to be allow my asp.net application to access the database. What i m wondering now is what will happen if two or more users connect to my asp.net application and try to do some operation on the database. w...

How to get an access to MS Access database?
Is it possible to get normal access to MS Access database without OLE DB drivers just with methods of ASP.NET. The problem is that the hoster set trust level to medium and does not allow using of OLE DB drivers. Thank you....

How to access the MS access database for different domains.
 I have three domains configured on the same server (one IIS server).and i have three copies of the same Access database for three different domains. i want that only one copy the MS Acess database can share the three domains.  How can i accomplish this task. thanks in advance. zainullah...

Single user access on MS Access database
We just transitioned our DATA volume from a Netware traditional volume to a iSCSI connected NSS volume on a NetApp Filer FAS 270. Netware 6.5 Since the move we've noticed a MS Access database issue arise. When the database is opened by the next user they receice the error message: "MSysAccessObjects can not be opened it is currently opened by another user" This is an Access file table not a custom table. Is it a Oplocks and/or File Caching issue on the server? If so, where can I tuen that off? Does anyone know of any issues regarding MS Access and NSS volu...

Data Access using MS Access Database
I am writing an application I am writing in VS 2005 Web Developer.  I have been able to connect to my Access Database just fine, but I am having trouble pulling rows from the database.  I have a drop down list in order to choose an employee.  After the employee is picked I need to copy their address, city, state, and zip ifrom my table into text boxes on the form.  I have looked for a week now, but nothing goes beyond just the connection itself.  I can find plenty using sql, but not access.  Can anyone help? Most of the SQL examples you will find for use ...

Ms-Access 2007 could not find my access database
hi, i trying to export datagrid to excel and for that i created database using Ms Access 2007 and when i tried to connect to my database its not connecting instead it is throwing an error "Could not find file 'D:\Application\Test\Excel.mdb" My connection is OleDbConnection cn = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;Data Source=Excel.mdb;"); could any one help me out why i m not able to connect it ...   Thanks & Regards,Ramesh.S,Software Engineer,http://www.rameshsengamalai.info  you code will be  OleDbConnection cn = ...

Accessing Sybase Database with MS Access 97
I'm trying to use Microsoft Access 97 to access a Sybase SQL Anywhere database. I can link to 95% of the tables, but I'm not allowed to link or import any of the tables created by "SYS". I need to access SYSTABLE, SYSCOLUMN, SYSDOMAIN, etc. As a matter of fact, not only am I not able to import the tables, I can't even see those tables when I'm presented with a list of tables to choose from in MS Access. Please reply to my e-mail address if possible! Thanks. -- Peter Lucas Decade Software Company peterlucas@mediaone.net Maybe Access is only listing ...

Accessing MS Access Database with security password
Hi, can anyone help me how to access my MS Access database that has a security password? Im using C# btw. ThanksDon't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. Look at www.connectionstrings.com for examples of all sorts of connection strings.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Thanks! Its all there.Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. Hello, I...

Accessing client-side MS Access database
My application was using MS SQL Server as a backend database, and we need to import records stored in a MS Access database which is located at client PC. An error message of "cannot find database at c:\...\....\abc.mdb was occured, is there any way to connect client-side database? You'd have to write an ActiveX DLL and require the user to allow it to be downloaded onto their PC. The only file you can access on the client's PC are cookie files... Jerry The only way you can import the records stored in the client's Access database is to make them upload it to the server and the...

accessing ACCESS database
Hi, I am trying to write a script that copies an information from ACCESS but it gives me the following error: Can't call method "Sql" on an undefined value at franowner.pl.txt line 4. Here's the script: use Win32::ODBC; $DSN="db1"; $db = new Win32::ODBC("db1"); $db->Sql("SELECT owner_first_name, owner_last_name FROM Owners WHERE ID=11"); if ($db->Error()) { print "Error: $db->Error"; } statement:\n$DBI:errstr\n"; ($ownerfname,$ownerlname) = $db->FetchRow(); print "Database results: first ...

Accessing MS Access
Hi all, This is probably a more DB oriented question, but it came out of the = DBI. I posted a question and have tried several solutions on how to open = up an MS Access DB from the DBI::ODBC but so far have been unable to. = What I had to end up doing was create a DTS that runs every 5 minutes = which copies the table I need from Access and populates a SQL Server = table. This causes a delay on my web application such that whenever my = page overlaps while the DTS is running I get no data. So I was wondering = if there is a better way to get information from Access so I can see it =...

MS access to MS access problem
I always used MS Access Database In my programs, now I want to use SQL SERVER database and so I started to design one. but it’s a little bit confusing ,I don’t know what can I use in change of these access Data type : MS access // MS access -------------- -------------------- Memo >>>>>>>> ?? AutoNumber >>>>> ?? * and if you think there is some difference between Ms access and SQL in D...

Web resources about - Accessing a MS Access database - asp.net.dotnetnuke

Highest Percentage Of Opera Mini Users Accessing Facebook? Macau
If you were asked to guess which country had the highest percentage of users of Opera mobile Web browser Opera Mini users accessing Facebook ...

International Users Accessing Facebook Places Through US VPN Accounts
By using a virtual private network (VPN) hosted in the United States, Facebook users from around the world are accessing Facebook Places. The ...

What are some alternatives to Yodlee for accessing bank information?
Clay Loveless , Founder, Jexy. Co-founder, Mashery. Founder, Jexy. Co-founder, Mashery.

Cloud Console - Accessing files in cloud storage for iPad on the iTunes App Store
Get Cloud Console - Accessing files in cloud storage on the App Store. See screenshots and ratings, and read customer reviews.

Meryl Streep On Accessing The Characters Within - YouTube
Meryl Streep talks about the importance of an actors work representing their ability. CONNECT WITH AFI: http://facebook.com/AmericanFilmInstitute ...

Accessing the Future Fund a sensible proposal, says super expert Daryl Dixon
As portfolios go, the Future Fund's asset allocation is concentrated in higher-risk investment, including equities and alternative assets.

Accessing my Super
I'm 57 - can I access my super?

Australia, US accessing Indonesian telephone data, leaked documents show
Newly disclosed documents from former US intelligence contractor Edward Snowden have revealed that Australian intelligence efforts against Indonesia ...

Euthanasia advocate Philip Nitschke detained at Melbourne Airport, accuses Customs officials of accessing ...
Euthanasia advocate Philip Nitschke has accused Customs officials of accessing hundreds of patients' sensitive records on his laptop after detaining ...

Frances Abbott scholarship: Sydney woman pleads guilty to accessing Whitehouse Institute records on PM's ...
A Sydney woman who leaked the student records of Tony Abbott's daughter pleads guilty. A Sydney woman who leaked the student records of Prime ...

Resources last updated: 12/15/2015 9:57:32 AM