Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - data source name too long.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

data source name too long.

 Post Reply Post Reply
Author
Badaboem View Drop Down
Senior Member
Senior Member


Joined: 12 April 2002
Location: Netherlands
Status: Offline
Points: 600
Post Options Post Options   Thanks (0) Thanks(0)   Quote Badaboem Quote  Post ReplyReply Direct Link To This Post Topic: data source name too long.
    Posted: 11 January 2004 at 4:24pm

Converting another part of my site 2 ms sql and came across this error, after adjusting the connection. I've imported the db tables into the forum ms sql database and I can read out the data, but cannot write to the database using the sql statement below.

Does anyone know what the issue is here?

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name too long.

Dim yYellName, yYellArray, tempstr, yYellMessage, yYellDate

yYellName = Trim(Replace(Replace(Replace(request.form("yellname"),"<" ,"["),">","]"),"'","APOS"))
tempstr = Replace(Replace(Replace(request.form("yellmessage"),"<","["),">","]"),"'","APOS")

yYellArray = Split(tempstr, " ")

for x = LBound(yYellArray) to UBound(yYellArray)
yYellMessage = yYellMessage & Excerpt(yYellArray(x),1,20) & ""
next

yYellDate = now()

' compiling SQL statement with variables.

set yYell = Server.CreateObject("ADODB.Connection")
strSQL = "INSERT INTO Yells (YellName,YellMessage,YellDate) VALUES ('" & yYellName & "','" & yYellMessage & "','" & yYellDate & "');"
yYell.Open strSQL, adoCon



Edited by Badaboem
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2004 at 9:30am
What type of connection are you using? I see you create the object and you open the connection but I don't see you defining it, anyway, the error can happend if you use something like
DSN=forum,USERID=sa,PASSWORD=sa,DATABASE=forum
as opposed to
DSN=forum;USERID=sa;PASSWORD=sa;DATABASE=forum
Back to Top
Badaboem View Drop Down
Senior Member
Senior Member


Joined: 12 April 2002
Location: Netherlands
Status: Offline
Points: 600
Post Options Post Options   Thanks (0) Thanks(0)   Quote Badaboem Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2004 at 10:26am

I use the connection defined by the ms sql forum itself by including common.asp. It doesn't complain that it can't find tables or anything because a different function with the same connection method works for retrieving data from the database.

It uses

'Enter the details of your SQL server below
strSQLServerName = "x" 'Holds the name of the SQL Server
strSQLDBUserName = "sa" 'Holds the user name (for SQL Server Authentication)
strSQLDBPassword = "x" 'Holds the password (for SQL Server Authentication)
strSQLDBName = "x"     'Holds name of a database on the server

Any suggestions?



Edited by Badaboem
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.