Page 1 of 2 12 LastLast
Results 1 to 15 of 23

Thread: Lytec

  1. #1
    Join Date
    Sep 2003
    Posts
    17

    Unanswered: Lytec

    My client would like to do some customized reporting from Lytec Medical XE. The software is built on Pervasive, and I can get a connection to the database working through ODBC, but then any ODBC commands fail. Does anyone know anything about making ODBC calls to the Lytec Medical Database?

    Thanks in advance.

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4

    Re: Lytec

    I've not worked specifically with Lytec but have worked extensively with Pervasive. What error are you getting from the ODBC Commands? What version of Pervasive are you using? What ODBC COmmands are you issuing?
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Sep 2003
    Posts
    17
    Lytec is using the Pervasive 2000i version. We are able to make the ODBC connection, and then if we go to run any kind of SQL command I get an error. The strange thing is that there are not any DDF files. Do we need to use Btrieve then to access the data?

    Thanks for the help.

  4. #4
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    What's the error you get?

    If you've got a connection to the database using ODBC, then you've got DDFs. However, that might be part of your problem. If the DDFs don't match, then you'll have problems.

    To be sure, what's the error?
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  5. #5
    Join Date
    Sep 2003
    Posts
    17
    Yeah I am connecting with ODBC though VB.NET, so its just coming up with an unhandled exception error. I am looking in the database directory and there seems to be no files that are .DDF though.

    From what I understand, ODBC is for relational databases and Btrieve is Sequential access? Does that make a difference if I am connecting to a database created in the Btrieve format vs. the relational database format? I read on another site that everything Lytec created uses Btrieve. So could I then use an ODBC connection to a database created with Btrieve?

    Thanks for your help. There isn't much documentation about what they have done, and their developers don't want to disclose too much information rightfully so.

  6. #6
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    There's no difference in the underlying data files between a "Btrieve" data base and a "relational" database. The only difference is that the "relational" database is accessed through ODBC or OLEDB.
    What happens if you catch the exception using a Try..Catch block and display the Exception message (like:
    Code:
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  7. #7
    Join Date
    Sep 2003
    Posts
    17
    OK I tried it again and its still just and exception, with no further info. All I am doing is connecting to the database and then trying to run a "SELECT * FROM PATIENT;" command.

    Is there a special way my connection string should be for the ODBC.NET provider and the Pervasive database?

    Thanks so much for all your help.

  8. #8
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Here's code I've used in VB.NET 2003:
    Code:
    Imports System.Data.Odbc
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim myConnString As String
            Dim mySelectQuery As String
            myConnString = txtConnStr.Text
            Dim myConnection As New OdbcConnection(myConnString)
    
            mySelectQuery = txtSQL.Text
    
            Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
            Dim i As Int32
            Dim sTemp As String
            Dim sTemp2 As String
    
            ListBox1.Items.Clear()
            Try
                myConnection.Open()
                Dim myReader As OdbcDataReader = myCommand.ExecuteReader()
    
                While myReader.Read()
                    For i = 0 To myReader.FieldCount - 1
                        Select Case myReader.Item(i).GetType().ToString
                            Case "System.TimeSpan"
                                Dim sTimeSpan As TimeSpan
                                sTimeSpan = myReader.Item(i)
                                sTemp2 = sTimeSpan.ToString
    
                            Case "System.DBNull"
                                sTemp2 = "null"
                            Case Else
                                sTemp2 = CStr(myReader.Item(i))
                        End Select
    
                        If i = 0 Then
                            sTemp = sTemp2
                        Else
                            sTemp = sTemp & ", " & Trim(sTemp2)
                        End If
                    Next
                    ListBox1.Items.Add(sTemp)
                    sTemp = ""
                End While
               ' always call Close when done reading.
                myReader.Close()
                ' always call Close when done with connection.
                myConnection.Close()
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
    End Sub
    This code uses a ListBox (called ListBox1), two TextBoxes (called txtConnStr and txtSQL), and a Button (called Button1).
    My default txtConnStr was set to: DSN=DEMODATA
    The txtSQL was set to: select * from class
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  9. #9
    Join Date
    Sep 2003
    Posts
    17
    Mirtheil,

    Thanks for all your help. I think I am going to start over and re-install the whole thing and then try your code.

  10. #10
    Join Date
    Sep 2003
    Posts
    17
    Mirtheil,

    OK here is something strange. I download the Lytec demo. (I don't have the actual Pervasive 2000i server installed) It somehow installs itself and the Pervastive 2000i database on the computer. It seems to run on any OS, so it must be some other version of the server which I am not sure about considering the regular Pervasive 2000i database only runs on NT, 2000 or 2003 Servers. When you start the Lytec program a little Database Server Manager starts in the system tray. It says: Pervasive.SQL 2000i SP4 version 7.94.251.003. It looks like the full blown version.

    Any ideas what kind of server this is? I can run it off XP Home, XP Pro, and 2000 as far as I know right now. It also has all the same files as the full version of the server.

  11. #11
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Pervasive comes in two flavors.
    Server Engine
    WOrkgroup Engine

    The Workgroup engine is designed to run on any Win32 OS (Win98, WinME, WinXP, Win2000, Win2003) and runs as an EXE in the user space. The Server engine runs on a "Server" platform. THere is a NetWare, Linux, and Windows server engine. The WIndows server runs as a Service on WinNT, Win2000, Win2003.

    If you're seeing a tray icon, you're running the workstation/workgroup engine. It's not the server engine. THe server engine runs as a service so you don't see a tray icon.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  12. #12
    Join Date
    Sep 2003
    Posts
    17
    ahhhh... no wonder.. OK, then I guess my next question is, how can I work with the Workgroup engine? Is there a good way to connect to the database using some developer tools, or is there a way to connect to it with VB.NET? I can't install any of the normal Pervasive tools since I don't have a server then.

  13. #13
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Actually, the SDK will install on either the Workgroup or Server ENgine.
    Using VB.NET, you can use either ODBC (with ODBC.NET) or the Btrieve API. THere is a sample on Pervasive's web site. THe code I posted worked for me.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  14. #14
    Join Date
    Sep 2003
    Posts
    17
    Mirtheil,

    Thanks for all your help. Yeah I installed it and am messing with it all now. I didn't realize that there was another version of Pervasive 2000i. This is a whole new database for us here.

    Thanks again.

  15. #15
    Join Date
    Sep 2003
    Posts
    1

    Did you ever figure this out?

    I' trying to connect to the Lytec .dbp files as well and I'm unable to right now. Amy ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •