Results 1 to 4 of 4

Thread: How to Print Rows of SQL Database

  1. #1
    Join Date
    Jul 2009
    Posts
    6

    How to Print Rows of SQL Database

    Please how can I print the contents of SQL Database in VB6 Application?

    I want to be able click a button in VB6 and it will print the rows of a SQL database. I want to print one row per page.

    For e.g

    Page 1
    Name Surname Age



    Page 2

    Name Surname Age

  2. #2
    Join Date
    Aug 2007
    Posts
    1,098

    Re: How to Print Rows of SQL Database

    i think there must be option in file menu for printing other wise you can convert it to excel and go for print ...ActiveX Data Objects (ADO) provide access to any type of data source. It is a flat object model with few objects. check here for more How to import data from Microsoft SQL Server into Microsoft Excel

  3. #3
    Join Date
    Dec 2008
    Posts
    202

    Re: How to Print Rows of SQL Database

    If you want to rewrite some modifications to an SQL table, first you need a select ZSQL method, and an Update SQL Tool Object. You need to use the fetchRow( ) and fetchInto( ) methods in your database and put data in numeric arrays. And in your program you need to use associative arrays or objects by passing an additional parameter to either method. For associative arrays, use DB_FETCHMODE_ASSOC:

    create table utest
    (id integer not null primary key,
    name varchar(100) not null,
    is_male smallint,
    birth_date date,
    birth_time time,
    modified timestamp);

    Code:
        while($row = $sth->fetchRow(DB_FETCHMODE_ASSOC)) {
            print $row['sign']."\n";
        }
    
        while($sth->fetchInto($row,DB_FETCHMODE_ASSOC)) {
            print $row['sign']."\n";
        }
    For objects, use DB_FETCHMODE_OBJECT:
    Code:
        while($row = $sth->fetchRow(DB_FETCHMODE_OBJECT)) {
            print $row->sign."\n";
        }
    
        while($sth->fetchInto($row,DB_FETCHMODE_OBJECT)) {
            print $row->sign."\n";
        }

  4. #4
    Join Date
    Jul 2009
    Posts
    6

    Re: How to Print Rows of SQL Database

    Please can someone post a working example.

    Preferably in a button click event.

    I want to click a button in visual Basic an it will print SQL database contents to a selected printer.

Similar Threads

  1. Replies: 3
    Last Post: 31-12-2011, 05:04 PM
  2. Open and print Access Database without access?
    By Boagrius in forum Software Development
    Replies: 6
    Last Post: 28-08-2010, 11:28 PM
  3. Replies: 3
    Last Post: 28-07-2010, 10:19 PM
  4. Replies: 2
    Last Post: 09-07-2009, 08:57 AM
  5. Print spooler hangs when trying to print from a shared print
    By Jisbomb in forum Windows XP Support
    Replies: 3
    Last Post: 27-07-2007, 10:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,647,803.36389 seconds with 16 queries