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

hi i have prob solve it plz

hi i written the script for database connectivity with ms access , connection is proper but the script can not display any reslut on browser .....

code is .....

Expand|Select|Wrap|Line Numbers
  1. #!usr/bin/perl
  2.  
  3. use Win32::OLE;
  4. use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
  5.  
  6. $table = "emptable";
  7. $conn = Win32::OLE->new("ADODB.Connection");
  8. $rs = Win32::OLE ->new("ADODB.Recordset");
  9. $conn->Open("emptable");
  10.  
  11. print "Content-type:text/html \n\n";
  12.  
  13. print "<div align = center> <font face = verdana color=#333399 size = 5> Address Book </font><br><br>";
  14. print "<table bgcolor =lightyellow><tr><th width=150 align = left>First Name</th>";
  15. print "<th width = 150 align= left>Last Name</th><th width=150 align=left>Address</th></tr>";
  16.  
  17. $sql = "select firstname,lastname, address from $table";
  18. $rs->Open($sql,$conn,1,1);
  19. while(! $rs->EOF)
  20. {
  21.     $firstname = $rs->Fields('firstname')->value;
  22.     $lastname = $rs->Fields('lastname')->value;
  23.     $address = $rs->Fields('Address')->value;
  24.     print "<tr><td>$firstname</td><td>$lastname</td><td>$Address</td></tr>";
  25.     $rs->MoveNext;
  26. }
  27.  
  28. print "</table></div>";
  29.  
  30. $rs->Close;
  31. $conn->Close;
  32.  
plz help me for solving my problem
Apr 4 '07 #1
1 1129
hi i written the script for database connectivity with ms access , connection is proper but the script can not display any reslut on browser .....

code is .....

Expand|Select|Wrap|Line Numbers
  1. #!usr/bin/perl
  2.  
  3. use Win32::OLE;
  4. use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
  5.  
  6. $table = "emptable";
  7. $conn = Win32::OLE->new("ADODB.Connection");
  8. $rs = Win32::OLE ->new("ADODB.Recordset");
  9. $conn->Open("emptable");
  10.  
  11. print "Content-type:text/html \n\n";
  12.  
  13. print "<div align = center> <font face = verdana color=#333399 size = 5> Address Book </font><br><br>";
  14. print "<table bgcolor =lightyellow><tr><th width=150 align = left>First Name</th>";
  15. print "<th width = 150 align= left>Last Name</th><th width=150 align=left>Address</th></tr>";
  16.  
  17. $sql = "select firstname,lastname, address from $table";
  18. $rs->Open($sql,$conn,1,1);
  19. while(! $rs->EOF)
  20. {
  21.     $firstname = $rs->Fields('firstname')->value;
  22.     $lastname = $rs->Fields('lastname')->value;
  23.     $address = $rs->Fields('Address')->value;
  24.     print "<tr><td>$firstname</td><td>$lastname</td><td>$Address</td></tr>";
  25.     $rs->MoveNext;
  26. }
  27.  
  28. print "</table></div>";
  29.  
  30. $rs->Close;
  31. $conn->Close;
  32.  
plz help me for solving my problem
Presumably the scripts compiles and runs from the command line. Make sure of that. And, In this line
print "Content-type:text/html \n\n";
delete the space between html and \n\n.
Apr 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: josephrthomas | last post by:
hi..i am trying to make a login page and i am using access table.. when the user enters his userid and password i want to check the password from the table.. if any user with the userID that is...
5
by: David Sobey | last post by:
Hi Sorry bout this basic prob. Got a file called file.obj. tryna read the first line from it as a string and print it to the screen. getting errors: #include "stdafx.h" #include <stdio.h>...
2
by: Dishan Fernando | last post by:
Hi my prob is like this.. ----------------------------- create table ax( i int , j int ) create table ay( i int ,
6
by: skubik | last post by:
Hi everyone. I'm attempting to write a Javascript that will create a form within a brand-new document in a specific frame of a frameset. The problem is that I can create the form and input...
2
by: Wilhelm Kutting | last post by:
hi, i like to solve a code-prob: tidy is bitching about <...> proprietary attribute "type" <...> lacks "action" attribute how can i make this nice? this is my code
2
by: Vamshi | last post by:
I do have some problems. Can any one help me out? 1.Ordered squares. A 6-digit number STWXYZ is an ordered number if the diff between first 3 dig, STW and last three XYZ is 1. For example 123124...
28
by: Vishal Naidu | last post by:
i m new to the C world... i ve been told by my instructors not to use goto stmt.. but no one could give me a satisfactory answer as to why it is so.. plz help me out of this dilemma, coz i use...
2
by: jophrthomas | last post by:
hi...i am getting a error here...saying : **quote** The ConnectionString property has not been initialized. Description: An unhandled exception occurred during the execution of the current web...
3
by: Mythran | last post by:
We have a web control. (Please note, all our libraries and controls are given a strong name). When we place the web control on a web page, it works fine. We are using a project reference to it...
1
by: sharat | last post by:
hello groups. i am using fc4, gcc compiler. I am usngi vectors in my program and i m facing memory corruption problem it is giving error as " ** glibc detected *** double free or corruption...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.