CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 FoxPro Database

Print topic Send  topic

Author Message
David
Posted: 12/19/2003, 5:21 PM

I need to connect to Visual Foxpro Database. It's created didn't support NULL string, How to insert the table using CCS. Beside that, how to insert the date and Logical format's Field into Foxpro table?.

Please advise.
Edd
Posted: 12/20/2003, 5:41 PM

I am not familiar with foxpro but the Null thing can be a pain.

The bad news is that CodeCharge Studio (rightly - but frustratingly) defaults blank stings as Nulls. To get around this you need to change the Common class for the project.

I will explain this in ASP you need to translate if you use PHP, etc.

Open up the common files, and open Common.asp file. Look for the function "ToSQL"

Where it says
If CStr(mValue) = "" OR IsEmpty(mValue) Then
ToSQL = "Null"
Else

Change the ToSQL = "Null"
to ToSQL = ""

Re the date issues check what you have set for the connection. I have a habit of setting all my connection "server" formats to yyyy-mm-dd hh:mm:ss as this works on 9.9 out of 10 Databases.

Hope this helps

Edd



David
Posted: 12/22/2003, 9:08 PM

I got this msg when try to insert/update the table, Data type mismatch.

Source: Record table1 / Insert Operation
Command Text: INSERT INTO table1(ccode, ddate, llogical, memo, nnumber) VALUES ('1000000001', '2003-12-23 00:00:00', 'true', ?, 1234.75)
Error description: Data type mismatch. (Microsoft OLE DB Provider for Visual FoxPro)<br>INSERT INTO table1(ccode, ddate, llogical, memo, nnumber) VALUES ('1000000001', '2003-12-23 00:00:00', 'true', ?, 1234.75)<br><br>

How to change the insert - sql workable at CCS?
Edd
Posted: 12/23/2003, 2:55 PM

David,
Re Dates I could not find any reference on how dates are formated in Foxpro so I suggest you try different formats through a manual SQL interface until you have the correct format, ie instead of YYYY-MM-DD HH:MM:SS try one of the multiples
YYYY-MM-DD
MM/DD/YYYY
MM-DD-YYYY
etc.

When you find the correct format change your connection information appropriately.

Good Luck,
Edd
P.S. After you find out what the format is, post a response in the forum so another poor sod does not have to go through what you have just done.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.