CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> IDE/GUI

 List Box Int Field format is wrong

Print topic Send  topic

Author Message
tim2boles

Posts: 16
Posted: 07/31/2007, 8:09 PM

I am new to using CodeCharge Studio and I am having problems with a List Box I created.

I am creating a Form for adding/updating contacts. Each contact has to be associated with a client, so there is a FK constraint in my MSSQL database between the client_id in the client table and the client_id in the contacts table.

Now I want a list box in the Add/Edit contacts that will allow someone to select based on client_name but populate the database with the client_id.

So within the Listbox:client_id I have the
CONTROL SOURCE TYPE = DATABASE COLUMN
CONTROL SOURCE = CLIENT_ID
CONNECTION=MSSQLDATABASECONNECTION
DATA SOURCE TYPE=Table/VIEW
DATA SOURCE = clients
BOUND column = client_id
TEXT COLUMN = client_name
DATA TYPE = Integer

When I go to the live page:
There is an error that appears: The value in field Client Id is not valid. Use the following format: .

Now I changed the DATA TYPE = TEXT and then I get an error saying that it can not convert 2.00 to an integer.

It seems to me that the format is for a float instead of an integer. Can someone point me in the right direction to get that fixed please.

Regards
Tim

View profile  Send private message
ReneS

Posts: 225
Posted: 08/01/2007, 2:44 AM

Hi,

Only thing that I can see is maybe the "type mismatch" integer and/or float. You need to correct that in your database. It should be integer. Use SQL server enterprise manager to check and/or correct your tables.

Hope this helps.....Otherwise the real experts will jump in...

Good luck,

Rene
View profile  Send private message
tim2boles

Posts: 16
Posted: 08/01/2007, 8:40 PM

Thanks for the reply, but the database is showing integer and so is the form.

Regards
Tim
View profile  Send private message
DonB
Posted: 08/02/2007, 7:19 AM

My guess is that you changed the database design after creating the dropdown
list? It sounds like CCS has recorded the column being text but you have it
defined as an integer. Sometimes the data sources get out of synch with the
database. It's easy enough to resolve - just open each datasource, open the
query builder on it, and click OK as if you'd made a change. This jogs CCS
into reconstructing the datasource metadata it maintains for the data source
and the listbox using it.

Although it's worth looking through your main page's code file to see if
there are any blocks of code 'locked', meaning they don't have the normal
grayed-background appearance. It might be that CCS is simply disallowed
from updating the code because you (or something) edited it - as indicated
by a white background on part of the code.

--
DonB

http://www.gotodon.com/ccbth


"tim2boles" <tim2boles@forum.codecharge> wrote in message
news:446b1522c993a8@news.codecharge.com...
> Thanks for the reply, but the database is showing integer and so is the
form.
>
> Regards
> Tim
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

wkempees
Posted: 08/02/2007, 8:16 AM

And to add to DonB,
In ProjectExplorer->Connections->"Connection" Refresh
might help.

"DonB" <~ccbth~@gotodon.com> schreef in bericht
news:f8sp4u$sh5$1@news.codecharge.com...
> My guess is that you changed the database design after creating the
> dropdown
> list? It sounds like CCS has recorded the column being text but you have
> it
> defined as an integer. Sometimes the data sources get out of synch with
> the
> database. It's easy enough to resolve - just open each datasource, open
> the
> query builder on it, and click OK as if you'd made a change. This jogs
> CCS
> into reconstructing the datasource metadata it maintains for the data
> source
> and the listbox using it.
>
> Although it's worth looking through your main page's code file to see if
> there are any blocks of code 'locked', meaning they don't have the normal
> grayed-background appearance. It might be that CCS is simply disallowed
> from updating the code because you (or something) edited it - as indicated
> by a white background on part of the code.
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "tim2boles" <tim2boles@forum.codecharge> wrote in message
>news:446b1522c993a8@news.codecharge.com...
>> Thanks for the reply, but the database is showing integer and so is the
> form.
>>
>> Regards
>> Tim
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
>
>

tim2boles

Posts: 16
Posted: 08/02/2007, 4:33 PM

Thanks for your insight but let me give you some more details, because I know for a fact it is not from my doing anything because it does the same thing when I create an application using the application buidler and as soon as I go to the Maintenance page of tables that have this particular setup as seen below:

I think that I did not represent the problem correctly. Let me try again.

I have two tables in Microsoft SQL that have columns of integer type.
clients.client_id is a primary key for the clients table.
contacts.client_id is a field in contacts that references the clients.clients_id (foregin key)

Now I build an application using code charger and let it build the forms. When I open to the Maintenance form for contacts (I do not select, update, delete or insert anything), I just choose Live Page in the tool. As soon as the page comes up an error displays:

Error message:
The value in field Client Id is not valid. Use the following format: .

Now I am trying to figure out where to change the format so that the Client Id is valid. When I look at the data type specified for the control it is integer. So I am thinking integer format should would since the control is client_id and the display is client_name.

--------------------------------Now my trouble shooting included----------
1) Changing the control type to text (just to see what it would do).

Results:
a) The first error message about formatting does NOT appear.
b) I can fill out the form choose and client_name but when I do ADD I receive a new error.

Database error: [Microsoft][ODBC SQL Server Driver][SQL Server] Conversion failed when converting the varchar value '1.00' to data type int.

That indicates to me that somewhere the application is reformating my integer into a float. Behind the scenes somewhere, why would it be doing this? My client_id should be derived from the selection.

2) Leave the control type as text and change the database so that the clients.client_id and contacts.contact_id are floats.
a) The error message about formatting does not appear.
b) I can fill out the form and I can add a new contact.

3) Change the control type to float and leave the client_id as floats.
a) The error message about formatting does not appear.
b) I can fill out the form and I can add a new contact.

----------I am at work today and can not try any of your suggests until after 6:00pm EST.----------

If your answer after reading this still the same that is fine. I will try and switch the connection to OLE DB, but don't understand why it would make a difference. I will also look at the code and see what it is doing.

Regards
Tim

8-)
View profile  Send private message
DonB
Posted: 08/02/2007, 6:00 PM

Then the only other logical explanation is that the driver you are using is
having problems. It doesn't sound like it interpretes datatypes correctly.

--
DonB

http://www.gotodon.com/ccbth

wkempees
Posted: 08/03/2007, 2:25 AM

@D,
Agreed the Connections->Design and Connections->Server
disagree as to which type.
Support?

Walter

"DonB" <~ccbth~@gotodon.com> schreef in bericht
news:f8tun8$j7p$1@news.codecharge.com...
> Then the only other logical explanation is that the driver you are using
> is
> having problems. It doesn't sound like it interpretes datatypes
> correctly.
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>

tim2boles

Posts: 16
Posted: 08/06/2007, 1:07 PM

Thanks,

I have contacted support and have given them the files and they are investigating it as best I can tell. I have the latest drivers that I know of...I am using the ODBC connections from Microsoft.

Regards
Tim
View profile  Send private message

Add new topic Subscribe to topic   


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.