tigrot Well-Known Member Licensed User Longtime User Oct 10, 2015 #1 Hi everybody, I'm writing a program using a DB written on a remote server. I had no issue with commands like insert(command only). Now I need a simple select to look for user data and I get. Fatto HandleJob: 16 Tag: USER, Columns: 7, Rows: 1 id user pass level data Societa Settore null net.sourceforge.jtds.jdbc.ClobImpl@39a2fcf6 net.sourceforge.jtds.jdbc.ClobImpl@63bfb063 net.sourceforge.jtds.jdbc.ClobImpl@68cf8c2a null net.sourceforge.jtds.jdbc.ClobImpl@4872f509 net.sourceforge.jtds.jdbc.ClobImpl@6699f5bd The result is OK but the field content seems to be a object reference. Code: Sub leggiuser Dim cmd As DBCommand cmd.Initialize cmd.Name = "readuser" cmd.Parameters = Array As Object(user, pass) reqManager.ExecuteQuery(cmd,0,"USER") End Sub the jobdone is Code: If Job.Success = False Then Log("Error: " & Job.ErrorMessage) Else Log("Fatto") If Job.JobName = "DBRequest" Then Dim result As DBResult = reqManager.HandleJob(Job) reqManager.PrintTable(result) If result.Tag = "USER" Then 'query tag If result.Rows.Size=0 Then Msgbox("Utente inesistente", "Login Utente") Job.Release Return End If For Each riga() As Object In result.Rows societa = riga(5) settore = riga(6) Log(societa) Log(settore) Next End If End If End If Job.Release End Sub The query is : sql.readuser=select * from accesso where [user]=? and pass=? Best regards Mauro Zanin
Hi everybody, I'm writing a program using a DB written on a remote server. I had no issue with commands like insert(command only). Now I need a simple select to look for user data and I get. Fatto HandleJob: 16 Tag: USER, Columns: 7, Rows: 1 id user pass level data Societa Settore null net.sourceforge.jtds.jdbc.ClobImpl@39a2fcf6 net.sourceforge.jtds.jdbc.ClobImpl@63bfb063 net.sourceforge.jtds.jdbc.ClobImpl@68cf8c2a null net.sourceforge.jtds.jdbc.ClobImpl@4872f509 net.sourceforge.jtds.jdbc.ClobImpl@6699f5bd The result is OK but the field content seems to be a object reference. Code: Sub leggiuser Dim cmd As DBCommand cmd.Initialize cmd.Name = "readuser" cmd.Parameters = Array As Object(user, pass) reqManager.ExecuteQuery(cmd,0,"USER") End Sub the jobdone is Code: If Job.Success = False Then Log("Error: " & Job.ErrorMessage) Else Log("Fatto") If Job.JobName = "DBRequest" Then Dim result As DBResult = reqManager.HandleJob(Job) reqManager.PrintTable(result) If result.Tag = "USER" Then 'query tag If result.Rows.Size=0 Then Msgbox("Utente inesistente", "Login Utente") Job.Release Return End If For Each riga() As Object In result.Rows societa = riga(5) settore = riga(6) Log(societa) Log(settore) Next End If End If End If Job.Release End Sub The query is : sql.readuser=select * from accesso where [user]=? and pass=? Best regards Mauro Zanin
tigrot Well-Known Member Licensed User Longtime User Oct 10, 2015 #2 SOLVED: some silly guy defined the fields as nvarchar(max) and I had to cast them in SQL to a limited size string... None is perfect... Upvote 0
SOLVED: some silly guy defined the fields as nvarchar(max) and I had to cast them in SQL to a limited size string... None is perfect...