Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Vbscript : Syntax Error using Getstring (ADO)

Posted on 2011-09-20
4
Medium Priority
?
960 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 1000 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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

719 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