kanber Posted January 3, 2020 Posted January 3, 2020 Hi, When I tried to read data from SQL server with ODBC. Int values reading OK. but On nvarchar(50) values I am getting NaN. Also on Table is showing "???" how can I solve the problem. sqlqr.ReceteAdi column is nvarchar(50). global dbase=db.Open("Deneme") //qr = DB.Query(dbase,"Select * from dbo.Receteler") global sqlqr = db.Query(dbase,"Select * from Receteler") db.Close(dbase)
AzeoTech Posted January 7, 2020 Posted January 7, 2020 Using regular Query is largely deprecated for the QueryToClass() function. Try that one instead. Not only is it faster (performance wise) and easier to use, it also has had more recent field type updates.
kanber Posted January 9, 2020 Author Posted January 9, 2020 Thank you. But I have problem read sys.Tables with nvarchar type. I need to get all table name for checking somethings. How can I do that. As I see daqfactory is support varchar types. but on that system column I can't change the type.
AzeoTech Posted January 10, 2020 Posted January 10, 2020 I believe NVarChar is for unicode. DAQFactory isn't compiled for unicode, and so even if you could read this field type, it wouldn't look right. Do a search on the web for converting NVARCHAR to VARCHAR inside a query (SELECT). For example, I quickly found a database forum that shows a CONVERT() function, as well as a CAST() function. I have not used these, but they, especially the cast() look quite promising.
kanber Posted January 11, 2020 Author Posted January 11, 2020 SELECT CONVERT(varchar(100),name) as name22 FROM sys.Tables solved my problem. thank you.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.