Re: how to create a string of values that can be used to insert in SQL server
- From: "Gerhard Gentele" <gfgentele@xxxxxxxxxxx>
- Date: Sun, 5 Nov 2006 14:52:46 +0100
I haven't worked with SQL before, but in the sourcecode below I had to solve
the problem that I wanted to send some files to a FTP server using
MSINET.OCX with the execute command. IN VB it was no problem, but in VFP I
hab to use a macro. To make it work, I dad to use the CHR() function wich
worked fine.
Here is the sourcecode that explains a solution for your question in line
12.
So long: Gerhard
**** sample to get a file via MSINET.OCX by Gerhard F. Gentele ****
thisform.inet1.AccessType = 0
thisform.inet1.Protocol = 2 && 1 DEFAULT 2 = FTP 4 HTTP siehe Properties
Protocol
thisform.inet1.RemotePort = 21 && 21 = FTP 80 = HTTP
thisform.inet1.URL = alltrim(UrlName2) && "ftp://ftp.gentec.net"
thisform.inet1.UserName = ALLTRIM(USERName2) && username
thisform.inet1.Password = ALLTRIM(Password2) && password
* now you can send a file with the following line to a FTP location
*thisform.inet1.execute(,"put N:\E\WmsinetUpload\pipilutsch.txt
/WK/pipilutsch.txt")
* you can connect variables to a macro that does the sending job
STORE ALLTRIM(SourceFile3) +" "+ ALLTRIM(destFile3) TO sendeMacro
* To manage the needed quotes you have to use CHR(34) instead of the quote
"<
* to make it work in the macro
sendemacro = CHR(34)+"get "+ sendemacro+CHR(34) && chr(34) ist
Anführungszeichen
* as the macro is ready you can execute it with the following line:
thisform.inet1.execute(,&sendemacro) && Sende mit Makro
SET CONSOLE ON
* now you have to wait until the operation get or put operation is done
DO WHILE thisform.inet1.StillExecuting && wenn .t. ist Übertragung noch am
laufen
?? CHR(7)
INKEY(1)
ENDDO
SET CONSOLE off
* afterward you close the connection
thisform.inet1.Execute(,"CLOSE")
* that was it
"Rajesh" <rajeshhalyal@xxxxxxxxx> schrieb im Newsbeitrag
news:1161314873.161948.6580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to create a string depending on the cursor fields & its
type to be used to pass it to insert command for SQL server.
I am having 2 problems
1> How to include character fields with quotes, square brackets & other
special characters.
2> How to send date fields.
Rajesh
.
- Follow-Ups:
- Prev by Date: Re: how can i POST over HTTP?
- Next by Date: Re: The best calendar control ?
- Previous by thread: Re: how can i POST over HTTP?
- Next by thread: Re: how to create a string of values that can be used to insert in SQL server
- Index(es):
Relevant Pages
|