Solved

Vbscript : Syntax Error using Getstring (ADO)

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now