Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: zakaria hamieh
  Where is zakaria hamieh?
 beirut
 Lebanon
 zakaria hamieh
 Tags
Subject: sql statment
Thread ID: 462267 Message ID: 462267 # Views: 51 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Thursday, December 6, 2018 1:04:53 PM         
   


dear experts

i am facing a problem with sql2005 server

i am trying to insert data in sql table :
**************************************
vstr = "insert into acmvt (movdate,accno,docno,dockind,amount,curamt,usdamt,kind,ser,desc_,ref,origcur,payway,paystat,ordno,chkno,company,saveser,computer,deleted,actual_dt);
values('"+dtocc(accmovement.movdate)+"','"+ltrim(accmovement.accno)+"','"+ltrim(accmovement.docno)+"','"+ltrim(accmovement.dockind)+"',"+ltrim(str(m.amount,14,2));
+","+ltrim(str(m.curamt,14,2))+","+ltrim(str(m.usdamt,12,2))+",'"+ltrim(accmovement.kind);
+"',"+ltrim(str(accmovement.ser,2))+",'"+ltrim(accmovement.desc)+"','"+ltrim(accmovement.ref)+"','"+ltrim(accmovement.origcur)+"','"+ltrim(accmovement.payway)+;
"','"+ltrim(accmovement.paystat)+"','"+ltrim(accmovement.ordno)+"','"+ltrim(accmovement.chkno)+;
"','"+ltrim(accmovement.company)+"',"+ltrim(str(accmovement.saveser,15))+",'"+m.computer+;
"','"+iif(accmovement.deleted,"1","0")+"','"+dtocc(accmovement.actual_dt)+"')"
if sqlexec(actptr,vstr)<0
sqlerror(1,4)
wait wind "error in sql"
return
endif

every time executing this command it gives me an error
i run the same above procedure on other computer and no error occured

what might be the problem

noting that connection sql server is established as follow

lcCONN='Driver={sql server}; server=mainserver;Dbq='+"ac18"+'; Uid=ac18; Pwd=accountmstr'
lcCONN = STRT(lcCONN,CHR(13),'')
lcCONN = STRT(lcCONN,CHR(10),'')
actptr = SQLstringCONNECT(lcCONN)
=INKEY(.1)
IF actptr<0
WAIT WINDOW 'Connection Failed...'
=AERROR(WTABE)
lnERRO = WTABE[1,1]
lcERRO = WTABE[1,2]
RETURN
ENDIF

thank you in advance
zakaria
foxes will always be running

ENTIRE THREAD

sql statment Posted by zakaria hamieh @ 12/6/2018 1:04:53 PM
RE: sql statment Posted by Tore Bleken @ 12/6/2018 1:14:45 PM
RE: sql statment Posted by Prasad Jamsandekar @ 12/6/2018 1:53:24 PM
RE: sql statment Posted by Martina Jindrov√° @ 12/6/2018 2:00:19 PM
RE: sql statment Posted by Koen Piller @ 12/6/2018 2:02:16 PM
RE: sql statment Posted by zakaria hamieh @ 12/6/2018 1:55:59 PM
RE: sql statment Posted by Tore Bleken @ 12/6/2018 3:00:28 PM
RE: sql statment Posted by zakaria hamieh @ 12/6/2018 3:56:27 PM
RE: sql statment Posted by tom knauf @ 12/6/2018 4:54:48 PM
RE: sql statment Posted by Tore Bleken @ 12/6/2018 5:45:24 PM
RE: sql statment Posted by zakaria hamieh @ 12/7/2018 9:15:55 AM
RE: sql statment Posted by Tore Bleken @ 12/7/2018 9:43:54 AM
RE: sql statment Posted by zakaria hamieh @ 12/7/2018 10:16:04 AM
RE: sql statment Posted by Tore Bleken @ 12/7/2018 10:18:54 AM
RE: sql statment Posted by Koen Piller @ 12/6/2018 5:05:01 PM
RE: sql statment Posted by Koen Piller @ 12/6/2018 1:40:17 PM
RE: sql statment Posted by zakaria hamieh @ 12/7/2018 9:17:47 AM
RE: sql statment Posted by Binod Binani @ 12/7/2018 6:59:33 AM