******CONNECTION STRING*******************
Public connectstring As String = "Provider= VFPOLEDB.1;Data Source = f:\crmswin;MODE=SHARE DENY NONE;EXCLUSIVE=FALSE;"
Public Function AddShopTicket(ByVal e As ShopTicket)
Dim ItemAdded As Boolean
e.nontax = False
e.Desc_text = False
e.Paid = False
Dim amt As Double = 0.0
e.Order_no = "00" + e.Order_no
mycommand = New OleDbCommand("", mycon)
mycommand.ExecuteNonQuery()
Dim dr As OleDbDataReader
Dim str As String = "INSERT INTO ordfile.dbf(Store_code,Order_no, cust_no, Cname, Cphone, Cphone2, Inv_no, Date_order,paid, salesman, ord_type, frt_amt, frt_code, tax_code, dep_amt, model, desc1, disc_type, non_tax, desc_text, po_num, project, type_cash, cash_amt, chk_amt, cc_amt, chk_no,cc_recno, dr_lic, inv_amt, state_tax, cnty_tax, city_tax, inv_tot, no_tax_typ, non_taxed, taxed_amt, amt_paid, user_id, inv_date, brand, serial_no, contact) VALUES (' ', '" & e.Order_no & "', '9999', '" & e.CustName & "', '" & e.phone & "', ' ', ' ', {" & e.DropDate & "}, .F., ' ', ' ', 0.00,' ', '37214', 0.00, '" & e.model & "', '" & e.status & "', ' ', .F., .T., ' ', ' ', ' ', 0.00, 0.00, 0.00, ' ', ' ', ' ', 0.00, 0.00, 0.00, 0.00, 0.00, ' ', 0.00, 0.00, 0.00, ' ', { }, '" & e.Brand & "', '" & e.Serial & "', '" & e.Contact & "')"
mycommand = New OleDbCommand(str, mycon)
Try
dr = mycommand.ExecuteReader
'mycommand = New OleDbCommand("USE ORDFILE SHARED INDEX ORDKEY", mycon)
'mycommand.ExecuteNonQuery()
'Dim str1 As String = "PACK ORDFILE.DBF"
dr.Close()
'mycommand = New OleDbCommand(str1, mycon)
'mycommand.ExecuteNonQuery()
ItemAdded = True
Catch ex As Exception
ItemAdded = False
MsgBox(ex.Message)
'MsgBox(ex.ToString)
'MsgBox("Error Adding Shop Ticket Into Ordfile.dbf", MsgBoxStyle.Critical)
End Try
Return ItemAdded
End Function