Solved

Vbscript : Syntax Error using Getstring (ADO)

Posted on 2011-09-20
4
935 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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