Re: how to create a string of values that can be used to insert in SQL server

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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



.



Relevant Pages

  • Re: VB code for filtering mail merge
    ... record in the macro recorder in Word 2002/3. ... database icon to select your Word data source, specify query options, then ... field and you should see what the SQL looks like. ... Connection string so that when you try to re-execute the recorded macro, ...
    (microsoft.public.word.mailmerge.fields)
  • RE: Using Excel and SQL
    ... it is best that you get it working manually while recording a macro and then ... Then select New SQL ... See if you can get any data from the server using this method. ... post the record macro. ...
    (microsoft.public.excel.misc)
  • Re: Mailmerge by macro
    ... >> c. to work out what SQL you need ... to close and re-open the data source using OpenDataSource and providing ... make the connection and the filter and sort ... But I want to run it on a macro. ...
    (microsoft.public.word.mailmerge.fields)
  • RE: Manipulating MS Access records with excel VBA + ADO
    ... and other SQL filters into the code. ... Then in the 1st macro ... You have the choice of searching through the database by making a SQL to ... ' Macro recorded 1/19/2009 by Joel ...
    (microsoft.public.excel.programming)
  • RE: Need to be able segregate units run in excel sheet using time.
    ... This is what I am trying to get back from the database. ... Can I use a macro to to determine the amount run within an hour or SQL. ... If I use the above would I puy this in the SQL query or Macro ...
    (microsoft.public.excel.programming)