Inserting row

Hi,

I want to insert row into a database(mysql). the code is works, but inserting the data randomly, not sorting.

[code]
if Listbox1.ListCount>0 then
dim totalrow as integer
totalrow = Listbox1.listcount-1
for x as integer = 0 to totalrow
dim a,b,c,d,e,f,g,h,ii,j,k,l,m as string
a=Listbox1.cell(x,0)
b=Listbox1.cell(x,1)
c=Listbox1.cell(x,2)
d=Listbox1.cell(x,3)
e=Listbox1.cell(x,4)
f=Listbox1.cell(x,5)
g=Listbox1.cell(x,6)
h=Listbox1.cell(x,7)
ii=Listbox1.cell(x,8)
j=Listbox1.cell(x,9)
k=Listbox1.cell(x,10)
l=Listbox1.cell(x,11)
m=Listbox1.cell(x,12)

  If AddTeamRow1(a,b,c,d,e,f,g,h,ii,j,k,l,m) then[/code]

How to make it inserting sort by queue.? I mean, what is exactly sort in listbox, has to be sorted to in database identically.

any helps ?

thanks

regards,
arief

Well, there is zero database insertion code here, so we have no way to help identify why it’s inserting at random.

  1. no where (as Tim said) are you inserting anything to a Database
  2. no where are you showing HOW you populated the listbox
  3. Listbox shows results in the order they were added using “ADDROW”
  4. if somewhere there is a Database SELECT statement, IT retrieves from the database in an order that is not guaranteed, unless the SQL query also includes an ORDER BY statement

if you want to set the same order in the listbox and in the database… maybe yo could add a column “order_number” and order both by that column