Solved

Accessing ACCESS Database

Posted on 1998-06-25
12
164 Views
Last Modified: 2013-12-25
1) How do I make a link that can extract data from ACCESS database and view it in other frame ?  If possible the steps taken is using ASP and if not then use CGi or Javascript.  For example: Link A will extract all name that start with A from the database

2) Do I need to install JDBC or ODBC kind of stuff ?

Thanks
0
Comment
Question by:khairi
  • 8
  • 4
12 Comments
 

Author Comment

by:khairi
ID: 1858417
Edited text of question
0
 

Author Comment

by:khairi
ID: 1858418
Adjusted points to 150
0
 
LVL 28

Accepted Solution

by:
sybe earned 150 total points
ID: 1858419
using ASP:

1. make an ODBC connection to the database, using ODBC32 in the control panel. Remember the name you gave it.

2. in your asp make a connection to the database using this code:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionTimeout = 15
Conn.CommandTimeout = 30
Conn.Open "DSN=TheNameYouGaveIt"
%>

3. Make a recordset with this code:

<%
strSQL = "SELECT * FROM Table"
Set RS = Conn.Execute(strSQL)
%>

You can strSQL is the SQL statement that you want, you can use any SQL statements that are valid to Access.


4. Display the data with a loop:

<%
Do While Not RS.EOF
 Response.write RS("Fieldname1") & " "
 Response.write RS("Fieldname2") & " "





 Response.write "<p><hr><p>"
RS.MoveNext
Loop
%>

0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:khairi
ID: 1858420
I have try the above statement given.... but on the SQL Server

I have make DSN for the above ... and test using SQL Server and the connection using ODBC32 is test successful

But when I open the ASP page ... it gave me error line at 12 which is the connection using the DSN

Where should I put the above statement.. in body or in head ..

Can I have your Email address?
0
 

Author Comment

by:khairi
ID: 1858421
opssss.... I found it .. my DSN is still not working ...

Let me test again
0
 
LVL 28

Expert Comment

by:sybe
ID: 1858422
Is it working now ?
0
 

Author Comment

by:khairi
ID: 1858423
Hmmm ... I'm not in good luck .. my server crashed last Saturday and I just got the server up this morning ... the secondary hdd failed ... have to restore my intranet again ...

Bit busy lately .. a  lot of customer complaining .... Hope to get this week
0
 

Author Comment

by:khairi
ID: 1858424
okay... im ready  but not at my server, at my pc using Personal Web Server using Access

i have put the code in the body section.  i have create one default page that have link to the a asp page that has the code to extract the file " http://nobody/contact/contact.asp "

okay,  when i click on the link ..it just open my asp file using my frontpage editor and hang there and message that the server is busy

what should i do ?
0
 
LVL 28

Expert Comment

by:sybe
ID: 1858425
ASP's should be in an executable virtual directory. So you'll have to make such a directory.
I would explain opening the ASP in FP editor because your browser has associated the extension .asp with Frontpage. This has to disappera when the ASP is executed on the server.


0
 

Author Comment

by:khairi
ID: 1858426
I have move my contact web page to new virtual directory at my server...on IIS on NT4

I now edit my asp using notepad program

When open the page ..http://server/contact.asp
the following error occur
1) "Microsoft OLE DB Provider for ODBC Drivers error '80004005'

   [Microsoft][ODBC Driver Manager] Data source name not
   found and no default driver specified

   /contact/contact.asp, line 15 "

2) "Microsoft OLE DB Provider for ODBC Drivers error '80004005'

   [Microsoft][ODBC Access 97 ODBC driver Driver]General
   error Unable to open registry key 'DriverId'.

   /contact/contact.asp, line 15"


I look at that line it about Conn.Open "DSN=contact"

So, I check at my ODBC32 Manager at control panel. The "contact" DSN is there but at which tab should I create ... there are
User DSN, System DSN, File DSN,

I have created the contact DSN at User and System tab
also I have try at File DSN still same error

0
 
LVL 28

Expert Comment

by:sybe
ID: 1858427
Create the ODBC in System DSN.
Error 1, means that the DSN could not be found
Error 2, is unknown to me
Maybe some one else knows ?
0
 

Author Comment

by:khairi
ID: 1858428
Thanks a lot
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
paypal ipn url 5 78
Query still returning duplicates 5 41
Eloquent ORM manual paginator defaults to simple 2 31
Magento: different theme for Pc and for mobile devices 4 31
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question