Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CA adapter and SQLServer key words
Message
From
06/05/2004 10:35:33
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00901000
Message ID:
00901559
Views:
23
Hi Mark. I tried out this code but unfortunately it would not work, This is because of some peculiarities in the builder code that I will endeavour to document.

I tried it out on a table that did NOT have a PK. but had SQL keywords as fields like "PLAN", "TYPE" DATE" and an ID field that was NOT a PK. The builder generated the code but I received a cryptic error. Finally I enlisted the help of the DBA and together we solved most of the problems.

No PK in the table so the update clause in the DMLCode is incomplete as there is no where clause generated. The update clause reads "UPDATE set ... where" No where clause since I was updating using the id field as the key field.

I am writing this from home and will send you a complete update of what I did to implement the changes. I gave up on the DMLCode section because of the incomplete 'where' as mentioned above.

I also added some custom methods that go into the base class that I use for updating, filling etc. as well as properties for checking conflicts(SP1)

I decided to use only the Autoupdate option where VFP generates the statements and this required only a change in one of the properties (adding the square brackets and testing for Native and Oracle.

Thanks for your input. I will be sending you the changes I nade soon.

Again, great class.

Bernard

>In the Cr8_DMLCode procedure, look for:
>
>lcInsert = lcInsert + [ ] + lcFName
>lcUpdate = lcUpdate + [ ] + lcFName + [ =]
>
>Try changing this to:
>
>lcInsert = lcInsert + " [" + lcFName + "]"
>lcUpdate = lcUpdate + " [" + lcFName + "] ="
>
>I will look at putting this in a CASE statement so the brackets are not used for VFP or Oracle tables. Let me know if those changes work. Thanks!
>
>
>>Hi Mark
>>
>>I have a problem with the system I am working on. Some of the fields in SQLServer are keywords like TABLE and DATE etc. This was from a legacy system I am converting to CS using your CA generator.
>>
>>I asked the Database Admin to change these fields and his reply made sense. He said that todays fields may become tomorrow's keywords. He has no problem accessing these fields provided he uses square brackets [TABLE] around the field in SQLQueries. He suggested why not I change the CA code so that square brackets went around ALL fields to make it future proof!
>>
>>This is good thinking, except I dont know how to do this. I know it must be in the _ca_autoupdate section or the _ca_dmlcode section.
>>
>>Could you point me in the right direction to implement this in your CA builder? I need to be able to query as well as update the table.
>>
>>TIA
>>
>>Bernard
Previous
Reply
Map
View

Click here to load this message in the networking platform