PDA

View Full Version : Lytec


RHAVLICK
09-04-03, 22:39
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.

mirtheil
09-14-03, 10:45
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?

RHAVLICK
09-14-03, 13:31
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.

mirtheil
09-14-03, 22:14
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?

RHAVLICK
09-14-03, 22:24
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.

mirtheil
09-14-03, 23:52
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:
Catch ex As Exception
MsgBox(ex.Message)
End Try

RHAVLICK
09-15-03, 11:11
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.

mirtheil
09-15-03, 12:31
Here's code I've used in VB.NET 2003:

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

RHAVLICK
09-15-03, 16:36
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.

RHAVLICK
09-15-03, 17:35
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.

mirtheil
09-15-03, 20:15
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.

RHAVLICK
09-15-03, 20:18
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.

mirtheil
09-15-03, 23:03
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.

RHAVLICK
09-15-03, 23:05
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.

nmcadmin
09-17-03, 15:58
I' trying to connect to the Lytec .dbp files as well and I'm unable to right now. Amy ideas?

RHAVLICK
09-17-03, 16:04
The problem I am still having is because I haven't figured out a way to move the Lytec database into the Pervasive Control Center. I can only connect to databases when the PervasiveOLEDB provider has a name in the Control Center. Is that the same problem you are having nmcadmin?

RHAVLICK
09-17-03, 21:18
Thought I would share:
http://dbforums.com/arch/26/2002/8/430017

RHAVLICK
09-18-03, 01:05
Alright gentlemen, here is a way to get into the Lytec database:

1) In Windows Explorer, create a new folder for your database.
2) In the Pervasive.SQL Control Center create a new database placing it into your new folder. In the Create Database wizard, check use Advanced settings.
3) Click the Create button. Name the database something. Click the Bound (DDF Created) check box, and click OK.
4) Click Next
5) Click Finish
6) In Windows Explorer navigate to the Lytec install directory (C:\Program Files\Lytec Systems\Lytec Medical XE) copy the four files (Field.ddf, File.ddf, Index.ddf, Version.ddf) to the new folder /database that you created, overwriting the current files.
7) You can either create a new practice in the Lytec Medical XE application pointing it to your new folder or you can take the demo data from the Tutor folder where the data was installed to.

When going back into the Pervasive.SQL Control center you will now see new tables when going into the database. Double clicking on the tables shows the data.

If anyone finds a way to make it so that the current data can be used without having to do this round about way, please let me know.

ewalkersc
01-15-04, 16:56
I am trying to get some custom reporting out of Lyutec and have found all posts helpful. I have setup what seems to be a working ODBC connection to Lytec Medical XE Release 4 Client/Server version by following the steps you setup. Basically take the existing data files on the server and leave them alone. Copy the .ddf files out of the program directory into the data directory. Go into the server's Pervasive control center and create a new database using the engine on the server and point the directory to the data directory then create the database by pointing it to the directory (DO NOT CREATE DDF). You will then have the database created. You can then go to a client with the pervasive client installed and create an ODBC connection by using the persavive data source and the database you just created. Seems to work fine. I can use crystal and VS to view data in the tables. Thanks to all the work done before me.

microwize
02-01-04, 13:08
What version of Lytec is this referring to? I would love to help

microwize
02-01-04, 13:09
Originally posted by microwize
What version of Lytec is this referring to? I would love to help

http://www.microwize.com

RHAVLICK
02-01-04, 14:41
I was just using the latest version of Lytec Medical 2004.

gnewfy
02-03-04, 14:12
We can provide your business with custom reporting. We specialize in data file repair and have built several custom reports for the the Lytec Medical program. Please visit our web site www.2kmedicalbilling.net for additional information or call Toll Free 866-372-3616.