Good evening, I have the following code that is generating the following error: object should first be initialized.
What am I doing wrong??
What am I doing wrong??
B4X:
Sub BtnGeraInv_Click
Qry="Select * from PRODUTOS order by CODBARRAS,QUANTIDADE"
Cursor1=SQL.ExecQuery(Qry)
If Cursor1.RowCount=0 Then
Cursor1.Close
Return
End If
TextWriter1.Initialize(File.OpenOutput(File.DirDefaultExternal, "coletor.csv", False))
For i = 0 To Cursor1.RowCount-1
Cursor1.Position=i
CODBARRAS= Cursor1.GetString("CODBARRAS")
QUANTIDADE = Cursor1.GetString("QUANTIDADE")
TextWriter1.Write(CODBARRAS & "," & QUANTIDADE & Chr(13) & Chr(10))
'TextWriter1.Write(Datex & "," & CC & "," & PC & "," & Qty & "," & Cost & "," & Sent & Chr(13) & Chr(10))
Next
TextWriter1.Flush
TextWriter1.Close
Cursor1.Close