kanber Posted January 3, 2020 Share 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) Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 7, 2020 Share 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. Quote Link to comment Share on other sites More sharing options...
kanber Posted January 9, 2020 Author Share 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. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 10, 2020 Share 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. Quote Link to comment Share on other sites More sharing options...
kanber Posted January 11, 2020 Author Share Posted January 11, 2020 SELECT CONVERT(varchar(100),name) as name22 FROM sys.Tables solved my problem. thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.