Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error: 'Column "XXX" not found' when using 'AS' in

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Data Objects Support
View previous topic :: View next topic  
Author Message
mos



Joined: 19 Nov 2006
Posts: 4

PostPosted: Sat Jan 13, 2007 12:04 am    Post subject: Error: 'Column "XXX" not found' when using 'AS' in Reply with quote

Hi,

I'm running (again) in troubles with my database (Sybase ASA). You will find a demo solution in your email, but without Sybase database.

I'd created a strongly typed virtualrecord class, inheriting from virtualrecord. I'd declared a simple SELECT statement in a new recordset class, inheriting from virtualrecordset. In the SELECT statement, I've used AS for renaming the columns from the database. I defined the properties in the new record according to the renaming of the columns and everything works fine, but ... I can't update the record after changing some value. The Update throws a COMException:

Quote:
System.Runtime.InteropServices.COMException was unhandled
Message="[Sybase][ODBC Driver][Adaptive Server Anywhere]Spalte nicht gefunden: Spalte 'Description' nicht gefunden"
Source="Microsoft OLE DB Provider for ODBC Drivers"
ErrorCode=-2147217865
StackTrace:
bei ADODB.RecordsetClass.Update(Object Fields, Object Values)
bei Infralution.VirtualData.VirtualRecord.Update(Recordset recordset, Boolean refreshRecordset)
bei Infralution.VirtualData.VirtualRecord.Update(Boolean refreshRecordset)
bei CMS.BasicPanel.EndEditing(Boolean saveChanges) in C:\Dokument ...

If i remove the AS statements, the values are updated in the correct way.

It seems to me, that VirtualRecordSet posts the false (means: the renamed instead of the the orginal) column name to ADO, but I dont know: I've tried the same thing with the Access Northwind Database and the updating works fine.

Do you have an idea, why the renaming wouldnt work with the Sybase ASA database? May be an error in the driver?

If you need the part of the database too, give me a hint.

Greeting,
Marc
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jan 15, 2007 7:10 am    Post subject: Reply with quote

This is almost certainly a problem with the Sybase ODBC driver. If you run your program under the debugger and look in the Output window you should see trace statements from VDO showing the actual SQL queries executed. You can try executing the same query directly using ADODB recordset and then doing the update directly. As you can see from the stack trace the VDO Update call is basically just a wrapper around the ADODB.RecordsetClass.Update method anyway.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Data Objects Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group