Solved

Vbscript : Syntax Error using Getstring (ADO)

Posted on 2011-09-20
4
944 Views
Last Modified: 2012-05-12
Hi,

I'm Using Vbscript to do a Request on a Oracle Database.
I'm using Getstring to put the output in a String then send it with Lotus Notes.
the problem is that Lotusscript ignores the CARRIAGE RETURN in my string.
So I wanted to change the Getstring options and I'm getting a syntax error and Idon't know why.

My Code :

connectionString = "DRIVER={Microsoft ODBC for Oracle};SERVER=SERVER;User Id=****;Password=****;"
ssql = "select Q3CPAI, Q3NUMG, Q3CTYM from hlmsenp, hlcriip "&_
"where q3cetm = '000' "&_
"And q3sens = '1' "&_
"And ( I0NA30 <>0 or I0NA40 <>0) "&_
"And q3scre = to_number(substr(to_char(sysdate,'YYYY'),1,2),'99') "&_
"And q3acre = to_number(substr(to_char(sysdate,'YYYY'),3,4),'99') "&_
"And q3mcre = to_number(to_char(sysdate,'MM'),'99') "&_
"And q3jcre = to_number(to_char(sysdate,'DD'),'99') "&_
"And i0nini in (select substr(q6nual, 9, 4) from hlmsiap where q6numg = q3numg)"
connADO.Open connectionString
Set rows = connADO.Execute(ssql)
rereq = rows.GetString(adClipString,3,,vbCrLf,)

I hope that I made myself understandable, if you need any more explainations just ask :)

Greetz,

Olivier
0
Comment
Question by:Yoo852
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36570590
VBscript or LotusScript ?? If this actually is LotusScript, I assume you didn't declare vbCrlf, nor did you specify Option Declare to force variables to be declared.

Add these lines:
      Dim vbCrlf As String
      vbCrlf= Chr$(13) & Chr$(10)
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 250 total points
ID: 36573191
In case you are using VBScript, you can do the same by putting as a first line in your script:

Option Explicit

Open in new window


Then of course you need to declare all your variables with Dim.

I just did that and it seems to me that what your missing is:

Const adClipString = 2

Open in new window


Maybe put that as the second line in your code.

I still got an error after that, I think you should just leave out the last comma if you want to use the default (empty string) for nulls:

rereq = rows.GetString(adClipString,3,,vbCrLf)

Open in new window

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36573422
Option Explicit is identical to Option Declare...
0
 

Author Closing Comment

by:Yoo852
ID: 36574508
I'm using Option Explicit.
for weeks I was searching for a solution, I changed almost everything to make it work ... except of course for the comma.
Many thx !!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question