42 users online (0 members and 42 guests)  


  Results 1 to 10 of 10

Related

  1. kerridge    Forum: Databases
    Replies: 1
  2. PERL-MYSQL connection using ODBC    Forum: CGI Perl Forum
    Replies: 0
  3. WIN32::API on .net    Forum: CGI Perl Forum
    Replies: 2
  1. #1
    sonu_cool's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    4

    Question Perl Win32::ODBC Kerridge

    Hi,
    Our company uses Kerridge database and I have got ODBC driver by which I an connect to Kerridge database.

    I have Win32::ODBC to connect to database.

    I have following code for connectivity :

    use Win32::ODBC;
    $db = new Win32::ODBC("DSN=kcml1;UID=pankm;PWD=****1234;");

    $DSN = "kcml1";
    if (!($db = new Win32::ODBC($DSN))){
    print "Error connecting to $DSN\n";
    print "Error: " . Win32::ODBC::Error() . "\n";
    exit;
    }

    $SqlStatement = "SELECT * from CF_01_WebUsers";
    if ($db->Sql($SqlStatement)){
    print "SQL failed.\n";
    print "Error: " . $db->Error() . "\n";
    $db->Close();
    exit;
    }
    print "Error: " . $db->Error() . "\n";
    while($db->FetchRow()){
    undef %Data;
    %Data = $db->DataHash();
    # ...process the data...
    }
    $db->Close();

    It connects fine with the database but fails to retun any datbase rows.

    IFor Example:
    If i type in wrong table name it gives me the following error message :
    SQL failed.
    Error: [2175] [2] [0] "[Kerridge][KISAM ODBC Driver][KISAM]verify table not found (CF_01_WebUsers1)"
    Please note that I have typed in worng table name.
    Please help!
    Thanks in advance.
    Regards
    Pankaj

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi welcome to the forums.

    Kerridge..is that the motor trade software? I always preferred Pinewood.

    Anyways. No errors at all, which is good. This bit:

    undef %Data;
    %Data = $db->DataHash();
    # ...process the data...
    }
    It doesn't actually do anything, does it? We have "Process The Data" but no actual processing.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    sonu_cool's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    4
    Hi QuietDean

    Thanks for your reply.

    Yes, Kerridge is Motor trade software. I'm trying to connect it using Perl.


    My code connects to DB fine but fails to return any rows.

    ==================
    while($db->FetchRow())
    {
    undef %Data;
    %Data = $db->DataHash();
    # ...process the data...
    }
    ==================

    Program does not even go in while loop. it just skips it.

    If i use the following it gives me the field name but no data.
    =====================================
    $db->FetchRow();
    %hash = $db->DataHash;
    foreach $key (sort(keys %hash)) {
    print $key, '=', $hash{$key}, "\n";
    }
    =====================================

    Any ideas?
    Regads,
    Pankaj

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    That's really odd. Some quick questions:

    1)Does Kerridge use its own database or is it a well-known database tacked onto the software?
    2)Is the Kerridge database actually working within Kerridge? In other words, is Kerridge running fine?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    sonu_cool's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    4
    1) Does Kerridge use its own database or is it a well-known database tacked onto the software?
    Well you can say that Kerridge uses thier own database tacked onto the software. ERP system is written in KCML which is extension of Wang2000.


    2)Is the Kerridge database actually working within Kerridge? In other words, is Kerridge running fine?
    yes, Kerridge database is working with in Kerridge system and it is working fine.

    =============
    Some drawbacks:

    As Kerridge ERP system and its database is properity software users are not allowed to view/edit details of the same. Any mods we have to request to Kerridge Computer company and they do all mods for you and change big money.

    Kerridge has provided a ODBC driver to connect to the Kerridge database.
    I can connect using ASP,VB script, Ms-Excel and see the database tables and data but I would like to do the same using Perl.

  6. #6
    MSAgent's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Posts
    1
    Hi

    I have a similar project coming up. In my case I'd want to connect with .asp/vb

    Have you actually managed to input records into Kerridge as well as extract them?

    Scaning through the Kerridge documentation, I see it's possible to extract with ODBC, but there's nothing little about inputting. The fact that it's proprietary makes me wonder whether they'd let you do do this?

    (My client has a huge list of data and want a quick way of importing these as new records into Kerridge.)

    Cheers.


    Quote Originally Posted by sonu_cool
    =============
    As Kerridge ERP system and its database is properity software users are not allowed to view/edit details of the same. Any mods we have to request to Kerridge Computer company and they do all mods for you and change big money.

    Kerridge has provided a ODBC driver to connect to the Kerridge database.
    I can connect using ASP,VB script, Ms-Excel and see the database tables and data but I would like to do the same using Perl.

  7. #7
    sonu_cool's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    4
    No you can input records to Kerridge database as ODBC driver only allows read only.

    try using VC++ as I find it is fast also.

    conact me if you need any help.
    [Email Removed]

    cheers
    Pankaj
    Last edited by QuietDean; 03-08-2005 at 06:04 AM.

  8. #8
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Sorry Pankaj, we remove email addresses as spam spiders tend to grab them.

    Anyone wishing to contact Pankaj for his generous offer of help, please click his username and choose "Private Message".
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  9. #9
    apushlar's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Posts
    2

    Same problem

    A Perl script of mine has recently been having the exact same problem. The ODBC is to an Access 97 database. I cut and pasted the SQL query into Access' SQL query interface, and it returns the rows just fine. And although the $db->Sql() on the exact same query doesn't return an error, $db->FetchRow() keeps claiming there are no rows returned.

    The odd thing is, this script has been running for over a year without a problem. Then last Friday (3/4) this started, although there haven't been any modifications.

    Can't figure out what happened -- my last guess at this point is that a Windows Update is causing it.

  10. #10
    apushlar's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Posts
    2
    Nevermind... found the problem. I increased the max buffer size, and it works again:

    $db->SetMaxBufSize(100000);

    There was a memo field in the database, and the first record returned had a particularly large amount of data in that field. It appears that when a returned row is larger than the buffer size, it just stops returning rows, rather than throwing an error.

    -Andrew



Tags for this Thread