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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL ADO onnection erors

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
Have just upgraded from acess to SQL and m attempting to
make minimul changes to the code. Quite striahgt forward but does anyone know wat I'm doing wrong
StrSqlMain = &quot;Select * from Message WHERE NameFor ='&quot; & UsernameSec & &quot;' AND Delete <> 1 and Recieved <> 1&quot;
CorkNameCheck.Open StrSqlMain, &quot;Provider=SQLOLEDB; Date Source=Samson; &quot; & &quot;Initial Catalog=message; User Id=**; Password=**&quot;, adOpenStatic, adLockUnspecified
eror message is run-time error '-2147467259(800004005):
invalid connetion string attribute
 
Here's your problem: Password=**&quot;, adOpenStatic
You missed a quotesign (or rather, you got it on the wrong place... :)

Good Luck
-Mats Hulten
 
Not quite understanding.
Have checked the big books of sleep for reference but still can't answer it.
Have now gone for trance music and internet insteed..
 
Check your string delimiters. (The &quot; )

Code:
StrSqlMain = &quot;Select * from Message WHERE NameFor ='&quot; & UsernameSec & &quot;' AND Delete <> 1 and Recieved <> 1&quot;
    CorkNameCheck.Open StrSqlMain, &quot;Provider=SQLEDB; Date Source=Samson; &quot; & &quot;Initial Catalog=message; User Id=**; Password=**&quot; & &quot;, adOpenStatic, adLockUnspecified&quot;

-Mats Hulten
 
Does not seem to fix the problem
Any other ideas?
 
Fixed it had to add a adodb.connection insteed of the previous way where I was only using a record set.
The other thing to note is that one of the fields that I was using was called &quot;delete&quot;.. SQL uses this word as [delete]. So in the string it should read
StrSqlMain = &quot;Select * from Message WHERE NameFor ='&quot; & UsernameSec & &quot;' AND [Delete] <> 1 and Recieved <> 1&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top