Print Page | Close Window

data source name too long.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=8783
Printed Date: 30 March 2026 at 1:57pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: data source name too long.
Posted By: Badaboem
Subject: data source name too long.
Date 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




Replies:
Posted By: michael
Date 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

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Badaboem
Date 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?




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net