Did you import the .scx file? If you did you will have a .scp file in your App folder. You can just run the form using the "do" command from the console.
However, there was an issue importing scx files correctly in Beta10 which we have fixed in Beta11 which we expect to release soon.
After you have tested that your form displays and works as expected in the console. you can then "embed" the form inside a "Custom Section" in a "page" in the "page attributes" dialog.
After using the dbc importer, you will have a Lianja database with your tables and production indexes. You can then access these with OPEN DATABASE, SQL statements and USE and other NoSQL commands from the Console, scripts and programs or using drag and drop and attribute assignment in standard Lianja sections.
After using the pjx/vcx/scx importer you will have the source code for your scx (renamed to scp), vcx (renamed to vcp) and prg files grouped in an App. These files can then be called with DO, SET CLASSLIB, SET LIBRARY etc from the Console or other programs. Try running your starting program/form from the Console with DO and see how you get on.
Errors are reported in the Error output window and you can get debug tracing if tracking is proving difficult (http://www.lianja.com/community/show...d-to-find-bugs). You could also create Custom VFP Lianja sections (http://www.lianja.com/resources/blog...-visual-FoxPro) and reuse relevant parts of your imported code.
Q:
To use Lianja, we would envision creating code that would look for the presence of a .dbc file. If none is found, the code would create a Lianja database file. Then it would import/convert the old .dbf file into a Lianja table via an import command. Does such a command exist or can one be created?
A:
Lianja provides a FILETYPE() function and a CONVERT command so you could USE the table in question, check the FILETYPE() and if it's a VFP table CONVERT it to a Lianja format dbf.
The basic CONVERT syntax is as follows:
Code:
CONVERT DBF <filename>
<filename> can contain wildcards, so for example:
Code:
CONVERT DBF conv*.dbf
Q:
How do I import a project, screen, etc.
A:
Just drag the .pjx .scx or .vcx file onto the "Files" explorer panel in the "Apps" workspace.
Create an "App" with whatever name you want.
Drag the .pjx file (or .scx or .vcx file) onto the "Files" panel and it will import the .scx and .vcx files creating .scp and .vcp files. These are just normal .prg files with a special extension to distinguish them from normal .prg files. You can now double-click on them and edit them.
You can then see what works and what does not in those forms and class libraries.
Class libraries are nothing special, just use SET PROCEDURE TO name.vcp to make the classes available.
Forms are just .prg files so just DO FORM name.scp
After reading through your many posts it seems to me that your focus is on working the way you used to with VFP.
You stated earlier that you are interested in Lianja for web and mobile in the future.
if you continue down this road of wanting to hand code your own classes that subclass other classes etc etc then that goes completely against the basic principles behind Lianja app development.
Why? Because Lianja has a core methodology for building cross platform, cross client applications which VFP does not.
Applications are broken down to consist of many smaller Apps.
Apps are built out of Pages.
Pages are built of of Sections.
There are many prebuilt sections.
You control the UI by setting attributes.
You respond to actions using delegates.
Why? Because this is both scripting language and client (desktop, web, mobile) independent.
VFP OLEDB is just another ActiveX you can use this in Desktop and Web/Mobile Apps (Cloud Server handles ActiveX in v1.3).
Code:
private oConn, oRS, m_count
oConn = createobject("ADODB.Connection")
oRS = createobject("ADODB.Recordset")
lcConnString = "Provider=vfpoledb;Data Source=C:\Temp\Northwind\northwind.dbc"
oconn.ConnectionString = lcConnString
oconn.Open()
oRS.Open("select * from customers where customerid='BOTTM'", oconn)
m_count = oRs.fields.count
// display the first record selected
for i=0 to m_count
try
? "Name=" + oRS.Fields.item(i).Name + ",value=" + etos(oRS.Fields.item(i).Value)
catch
// ignore error from Memo
endtry
endfor
Notice how you must use the item() method on the Fields property as this is exposed only as a property not a method.
The output produced is as follows:
Code:
Name=customerid,value=BOTTM
Name=companyname,value=Bottom-Dollar Markets
Name=contactname,value=Elizabeth Lincoln
Name=contacttitle,value=Accounting Manager
Name=address,value=23 Tsawassen Blvd.
Name=city,value=Tsawassen
Name=region,value=BC
Name=postalcode,value=T2F 8M4
Name=country,value=Canada
Name=phone,value=(604) 555-4729
Name=fax,value=(604) 555-3745
Note: There is a known issue with retrieving memo fields using the VFP OleDB driver which is why I used TRY/CATCH to ignore the error.
All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
Bookmarks