If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Lytec

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-03, 21:39
RHAVLICK RHAVLICK is offline
Registered User
 
Join Date: Sep 2003
Posts: 17
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.
Reply With Quote
  #2 (permalink)  
Old 09-14-03, 09:45
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #3 (permalink)  
Old 09-14-03, 12:31
RHAVLICK RHAVLICK is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 09-14-03, 21:14
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #5 (permalink)  
Old 09-14-03, 21:24
RHAVLICK RHAVLICK is offline
Registered User
 
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.
Reply With Quote
  #6 (permalink)  
Old 09-14-03, 22:52
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #7 (permalink)  
Old 09-15-03, 10:11
RHAVLICK RHAVLICK is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 09-15-03, 11:31
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #9 (permalink)  
Old 09-15-03, 15:36
RHAVLICK RHAVLICK is offline
Registered User
 
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.
Reply With Quote
  #10 (permalink)  
Old 09-15-03, 16:35
RHAVLICK RHAVLICK is offline
Registered User
 
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.
Reply With Quote
  #11 (permalink)  
Old 09-15-03, 19:15
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #12 (permalink)  
Old 09-15-03, 19:18
RHAVLICK RHAVLICK is offline
Registered User
 
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.
Reply With Quote
  #13 (permalink)  
Old 09-15-03, 22:03
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #14 (permalink)  
Old 09-15-03, 22:05
RHAVLICK RHAVLICK is offline
Registered User
 
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.
Reply With Quote
  #15 (permalink)  
Old 09-17-03, 14:58
nmcadmin nmcadmin is offline
Registered User
 
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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On