Incorrect syntax near keyword 'ON' ????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
i was trying to create a DB in a SQL Server.
but when i try to connect it with :

Dim conn As SqlConnection = New SqlConnection("Initial Catalog=master; " & _
"Data Source=SERVER-MACHINE;" & _
"UID=sa; PWD=;")

It gave me this SQLexception "Incorrect syntax near keyword 'ON"
which i have no idea what it means............

but when i tried to remove the UID and PWD
it saids "Login fails for user:(null). Reason: Not associated with a trusted
SQL Server connection".

Any help is appreciated......many thanks.
 
Jon said:
hi,
i was trying to create a DB in a SQL Server.
but when i try to connect it with :

Dim conn As SqlConnection = New SqlConnection("Initial Catalog=master; " &
_
"Data Source=SERVER-MACHINE;"
& _
"UID=sa; PWD=;")

It gave me this SQLexception "Incorrect syntax near keyword 'ON"
which i have no idea what it means............

but when i tried to remove the UID and PWD
it saids "Login fails for user:(null). Reason: Not associated with a
trusted
SQL Server connection".

Any help is appreciated......many thanks.

Sounds to me the problem is located in one of your SQL strings. Did you set
a SqlCommand object first?

Dave
 
Back
Top