Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dim Connection String for SQL

Status
Not open for further replies.
Jun 1, 2004
65
US
I've been given a very old code that I need to trouble shoot but can't seem to get pass a certain error everytime I run the script:

Script: Reporter.vbs
Line: 9
Char: 21
Error: Expected end of Statement
Code: 800a0401
Source MS VBScript

Googling the error comes up that it's a syntax error but I can't seem to find it. I've enclosed a copy of the script to see if anyone else can help me on this.

Thanks
Imports System.Data.SqlClient
Imports System.Web


Module Module1

Sub Main()

Dim connect As New SqlConnection("Initial Catalog = Lumigent; Data Source=sqlserver; User ID=; password = ; Connect Timeout=60")
Dim msgBody As String
Dim UserHeader As String = "Username"
Dim DatabaseHeader As String = "Database"
Dim TableHeader As String = "Table"
Dim OperationHeader As String = "Operation"
Dim CountHeader As String = "Count"
Dim cmdLine As String = System.Environment.CommandLine
 
Is there a solution to this? I am having the same problem on a similar scirpt; opening a connection to a SQL database.

Thanks.
 
It's all in the connection string, if it is not formed properly for your provider, you will get an error. Check the link I posted above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top