Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Read![] Command for VBS

Author  Topic 

jekessler
Starting Member

2 Posts

Posted - 2012-05-02 : 14:12:09
I have a short snippet of VBA code:

Command = "SELECT Private_Event_Code FROM dbo.EventCodeTrackerOutlook"
With conSQL
.Open strConnection
Set Read = .Execute(Command)
FileReadEvent = Read![Private_Event_Code]
End With

Read.Close
conSQL.Close

This works great for VBA, however I would like to change it to VBS. The issue is, when I do, it is telling me that I cannot use Read![] in VBS. Is there an alternative to using that in VBS? Any suggestions are appreciated. Thanks everyone.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2012-05-02 : 14:31:02
This work? (didn't test it)
FileReadEvent = Read("Private_Event_Code")


Edit: by the way, bad idea to use reserved keywords (Read) as variable or object names.
Go to Top of Page

jekessler
Starting Member

2 Posts

Posted - 2012-05-02 : 14:47:47
Thanks! That worked great.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2012-05-02 : 15:02:53
Glad to help
Go to Top of Page
   

- Advertisement -