excel vba - Vba- Query table limit for database table with a column having data type as nvarchar(5000) -


i have excel application button click connects hana database using hana client (hdbodbc) , put data in sheet after fetch. method working fine except tables having column data type nvarchar(5000). in case, column values not displaying correctly. example, have unique id auto increment column, starts showing 0 many rows. below method using -

function importroutine(sheet string, provider string, databaseschema string, server string, app string, row long, column long, commandtext string, displayname string, errorflag boolean) integer     debug.print commandtext     dim l querytable     dim rs object     dim cnt adodb.connection     dim cmd adodb.command     dim icols integer     set cnt = new adodb.connection     set cmd = new adodb.command     set rcd = new adodb.recordset  dim rangesheet string rangesheet = sheets(sheet).cells(row + 1, column).address dim connectionsheet string connectionsheet = "driver=" + provider + ";servernode=" + server + ";" + getauthentication + "; cs=" + databaseschema + ""  cnt.connectionstring = connectionsheet cnt.open  set cmd.activeconnection = cnt cmd.commandtext = commandtext cmd.commandtype = adcmdtext      rcd.open commandtext, cnt '', adopenstatic   set rs = createobject("adodb.recordset") rs.activeconnection = cnt rs.open commandtext, cnt   sheets(sheet).listobjects.add(sourcetype:=3, source:=rs, destination:=range(sheets(sheet).cells(row, column).address)).querytable     '.commandtext = commandtext     '.commandtype = xlcmdsql     .rownumbers = false     .filladjacentformulas = false     .preserveformatting = true     .refreshonfileopen = false     .backgroundquery = true     .refreshstyle = xlinsertdeletecell     .savepassword = false    .savedata = true     .adjustcolumnwidth = false     .refreshperiod = 0     .listobject.name = displayname     .preservecolumninfo = false     on error resume next     .refresh backgroundquery:=false end     sheets(sheet).listobjects(displayname).tablestyle = "tablestylemedium10" importroutine = 0 call deleteconnection   closerecordset: rs.close set rs = nothing closeconnection: cnt.close set cnt = nothing  on error goto 0     end function  

the interesting part nvarchar limit different different excel version. excel 2010 - 500 excel - 2013- 3000 excel - 2016 - 4000 question is there limit on number of characters column in vba query tables each excel versions ? or there can change resolve ?

this how data appearing. can check unique_id identity column in database showing 0 many rows although in database fine.

enter image description here


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -