---
title: "Någon som vill hjälpa med koden ??"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/125671-någon-som-vill-hjälpa-med-koden"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Annderss"
published: "2005-04-03T17:03:01.000Z"
updated: "2005-04-06T19:59:59.000Z"
replies: 20
views: 655
page: 1
pages: 2
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/125671-någon-som-vill-hjälpa-med-koden"
---

# Någon som vill hjälpa med koden ??

_Sida 1 av 2._

## #1 — Annderss, 2005-04-03T17:03Z

<http://www.aspsidan.se/default.asp?page=forum&menu=4&fp=showPost&pId=375194&sida=3>

snitz forum

Permalänk: https://www.webforum.nu/p/125671

## #2 — Annderss, 2005-04-03T19:14Z

strDBType = "mysql"
strConnString = "driver={MySQL ODBC 3.51 Driver};option=4;server=localhost;user=username_se;password=password;DATABASE=databasnamn;" '##MySQL w/ MyODBC v3.51
strConnString = "snitz_forums_2000" ## DSN

och då får jag det felet:

Error Type:
Sun ONE ASP VBScript compilation (0x800A043A)
Error in date literal
config.asp, line 51, column 39

När jag tar bort raden 51 (strConnString = "snitz_forums_2000" ## DSN )

får jag följande:
Error Type:
ADODB.Connection.1 (0x80004005)
SQLState: S1000 Native Error Code: 1045 \[TCX\]\[MyODBC\]Access denied for user: 'root@localhost' (Using password: YES) 
inc_header.asp, line 105

Permalänk: https://www.webforum.nu/p/1583882

## #3 — @nders, 2005-04-03T19:16Z

Ta bort ## DSN från raden.

Permalänk: https://www.webforum.nu/p/1583883

## #4 — Annderss, 2005-04-03T19:21Z

och då 

There has been an error !!

The database could not be opened !!
Check your config.asp file and set the 
strConnString so it points to the database.
Also check if strDBType is set to the right databasetype.

Code : 80004005

Error Description : 
SQLState: IM002 Native Error Code: 0 \[DataDirect\]\[ODBC lib\] Data source name not found and no default driver specified

Permalänk: https://www.webforum.nu/p/1583888

## #5 — @nders, 2005-04-03T19:24Z

För det första ska du nog bara ha en rad där du definierar *strConnstring*. Kör du med dsn, eller dsn-less? Det borde nog vara den översta du ska använda, kan jag tänka mig, så ta bort den undre igen. Kontrollera då att du angett rätt användarnamn och lösenord i din connectionstring.

Permalänk: https://www.webforum.nu/p/1583891

## #6 — Annderss, 2005-04-03T19:32Z

Nu ser raden så här ut :

strDBType = "mysql"
strConnString = "driver={MySQL ODBC 3.51 Driver};option=4;server=localhost;user=username_se;password=password;DATABASE=databasnamn;" '

och felet :

Error Type:
ADODB.Connection.1 (0x80004005)
SQLState: S1000 Native Error Code: 1045 \[TCX\]\[MyODBC\]Access denied for user: 'root@localhost' (Using password: YES) 
inc_header.asp, line 105

Permalänk: https://www.webforum.nu/p/1583896

## #7 — @nders, 2005-04-03T19:34Z

> Kontrollera då att du angett rätt användarnamn och lösenord i din connectionstring.

Permalänk: https://www.webforum.nu/p/1583898

## #8 — Annderss, 2005-04-03T19:38Z

det är rätt

Permalänk: https://www.webforum.nu/p/1583900

## #9 — Annderss, 2005-04-03T19:40Z

och filen inc_header.asp :

set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

Permalänk: https://www.webforum.nu/p/1583902

## #10 — Annderss, 2005-04-03T19:42Z

Sajten ligger hos b-one.se

Permalänk: https://www.webforum.nu/p/1583903

## #11 — Annderss, 2005-04-03T20:07Z

Någon ?

Permalänk: https://www.webforum.nu/p/1583915

## #12 — Annderss, 2005-04-04T04:31Z

ingen ?

Permalänk: https://www.webforum.nu/p/1583978

## #13 — ConnyFox, 2005-04-04T06:18Z

Hmm e inte helt 100 men b-one kör väll chiliasp, tror connectionstringen ser lite annorlunda ut då, typ user heter UID och password heter PWD.

exempel finns i b-ones support.
<https://www.b-one.net/static/support-faq.do?category=asp&number=5>

Attans nedrans chiliasp \*inte gilla alls\*

Permalänk: https://www.webforum.nu/p/1583981

## #14 — Annderss, 2005-04-04T15:33Z

Är det bara det som är skillnad ??

Permalänk: https://www.webforum.nu/p/1584207

## #15 — Annderss, 2005-04-04T16:41Z

The database could not be opened !!
Check your config.asp file and set the 
strConnString so it points to the database.
Also check if strDBType is set to the right databasetype.

Code : 80004005

Error Description : 
SQLState: S1000 Native Error Code: 1045 \[TCX\]\[MyODBC\]Access denied for user: 'root@localhost' (Using password: YES)

Permalänk: https://www.webforum.nu/p/1584229

## #16 — Annderss, 2005-04-05T15:43Z

Vet någon ??

Permalänk: https://www.webforum.nu/p/1587636

## #17 — ConnyFox, 2005-04-06T05:23Z

visa din kod

Permalänk: https://www.webforum.nu/p/1587922

## #18 — Sjodahl, 2005-04-06T06:18Z

skall du verligen logga in som root?
Kontrollera så att du skickar med korrekt lösen och användarnamn.

"Access denied for user: 'root@localhost' "

Permalänk: https://www.webforum.nu/p/1587928

## #19 — Annderss, 2005-04-06T17:43Z

Filen heter config.asp :

\<!--#INCLUDE FILE="inc_adovbs.asp"--\>
\<%
Session.LCID = 1033 '## Do Not Edit     
Response.Buffer = true

dim strDBType, strConnString, strTablePrefix, strMemberTablePrefix, strFilterTablePrefix '## Do Not Edit
Dim counter, ConnErrorNumber, ConnErrorDesc, blnSetup '## Do Not Edit

strDBType = "mysql"

strConnString = "driver={MySQL ODBC 3.51 Driver};option=4;server=localhost;user=username;password=password;DATABASE=databasnamn;" '
 

strTablePrefix = "FORUM\_"
strMemberTablePrefix = "FORUM\_"
strFilterTablePrefix = "FORUM\_"  'used for BADWORDS and NAMEFILTER tables

'#################################################################################
'## If you have deleted the default Admin account, you may need to change the
'## value below.  Otherwise, it should be left unchanged. (such as with a new
'## installation)
'#################################################################################

Const intAdminMemberID = 1

'#################################################################################
'## intCookieDuration is the amount of days before the forum cookie expires
'## You can set it to a higher value
'## For example for one year you can set it to 365
'## (default is 30 days)
'#################################################################################

Const intCookieDuration = 30

%\>
\<!--#INCLUDE FILE="inc_iconfiles.asp"--\>
\<%
'#################################################################################
'## Do Not Edit Below This Line - It could destroy your forums and lose data
'#################################################################################

Dim mLev, strLoginStatus, MemberID, strArchiveTablePrefix
Dim strVersion, strForumTitle, strCopyright, strTitleImage, strHomeURL
Dim strForumURL, strAuthType, strSetCookieToForum, strEmail, strUniqueEmail
Dim strMailMode, strMailServer, strSender, strDateType, strTimeAdjust
Dim strTimeType, strMoveTopicMode, strMoveNotify, strIPLogging, strPrivateForums
Dim strShowModerators, strAllowForumCode, strIMGInPosts, strAllowHTML, strNoCookies
Dim strHotTopic, intHotTopicNum, strSecureAdmin
Dim strAIM, strICQ, strMSN, strYAHOO
Dim strFullName, strPicture, strSex, strCity, strState
Dim strAge, strAgeDOB, strCountry, strOccupation, strBio
Dim strHobbies, strLNews, strQuote, strMarStatus, strFavLinks
Dim strRecentTopics, strAllowHideEmail, strHomepage, strUseExtendedProfile, strIcons
Dim strGfxButtons, strEditedByDate, strBadWordFilter, strBadWords, strDefaultFontFace
Dim strDefaultFontSize, strHeaderFontSize, strFooterFontSize, strPageBGColor, strDefaultFontColor
Dim strLinkColor, strLinkTextDecoration, strVisitedLinkColor, strVisitedTextDecoration
Dim strActiveLinkColor, strActiveTextDecoration, strHoverFontColor, strHoverTextDecoration
Dim strHeadCellColor, strHeadFontColor, strCategoryCellColor, strCategoryFontColor
Dim strForumFirstCellColor, strForumCellColor, strAltForumCellColor, strForumFontColor
Dim strForumLinkColor, strForumLinkTextDecoration, strForumVisitedLinkColor, strForumVisitedTextDecoration
Dim strForumActiveLinkColor, strForumActiveTextDecoration, strForumHoverFontColor, strForumHoverTextDecoration
Dim strTableBorderColor, strPopUpTableColor, strPopUpBorderColor, strNewFontColor, strHiLiteFontColor, strSearchHiLiteColor
Dim strTopicWidthLeft, strTopicNoWrapLeft, strTopicWidthRight, strTopicNoWrapRight, strShowRank
Dim strRankAdmin, strRankMod, strRankColorAdmin, strRankColorMod
Dim strRankLevel0, strRankLevel1, strRankLevel2, strRankLevel3, strRankLevel4, strRankLevel5
Dim strRankColor0, strRankColor1, strRankColor2, strRankColor3, strRankColor4, strRankColor5
Dim intRankLevel0, intRankLevel1, intRankLevel2, intRankLevel3, intRankLevel4, intRankLevel5
Dim strSignatures, strDSignatures, strShowStatistics, strShowImagePoweredBy, strLogonForMail
Dim strShowPaging, strShowTopicNav, strPageSize, strPageNumberSize, strForumTimeAdjust
Dim strNTGroups, strAutoLogon, strModeration, strSubscription, strArchiveState, strUserNameFilter
Dim strFloodCheck, strFloodCheckTime, strTimeLimit, strEmailVal, strProhibitNewMembers, strRequireReg, strRestrictReg
Dim strGroupCategories, strPageBGImageUrl, strImageUrl, strJumpLastPost, strStickyTopic, strShowSendToFriend
Dim strShowPrinterFriendly, strShowTimer, strTimerPhrase, strShowFormatButtons, strShowSmiliesTable, strShowQuickReply
Dim SubCount, MySubCount

strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))
strUniqueID = "Snitz00"
If Application(strCookieURL & "ConfigLoaded")= "" Or IsNull(Application(strCookieURL & "ConfigLoaded")) Or blnSetup="Y" Then

	on error resume next

	blnLoadConfig = TRUE

	set my_Conn = Server.CreateObject("ADODB.Connection")
	my_Conn.Errors.Clear
	Err.Clear

	my_Conn.Open strConnString
	for counter = 0 to my_conn.Errors.Count -1
		ConnErrorNumber = Err.Number
		ConnErrorDesc = my_Conn.Errors(counter).Description
		If ConnErrorNumber \<\> 0 Then
			If blnSetup \<\> "Y" Then
				my_Conn.Errors.Clear
				Err.Clear
				Response.Redirect "setup.asp?RC=1&CC=1&strDBType=" & strDBType & "&EC=" & ConnErrorNumber & "&ED=" & Server.URLEncode(ConnErrorDesc)
			else
				blnLoadConfig = FALSE
			end if
		end if
	next

	my_Conn.Errors.Clear
	Err.Clear 

	'## if the configvariables aren't loaded into the Application object
	'## or after the admin has changed the configuration
	'## the variables get (re)loaded

	'## Forum_SQL
	strSql = "SELECT \* FROM " & strTablePrefix & "CONFIG_NEW "

	set rsConfig = my_Conn.Execute (strSql)

	for counter = 0 to my_conn.Errors.Count -1
		ConnErrorNumber = Err.Number
		If ConnErrorNumber \<\> 0 Then
			If blnSetup \<\> "Y" Then
				my_Conn.Errors.Clear
				Err.Clear

				strSql = "SELECT C_STRVERSION, C_STRSENDER "
				strSql = strSql & " FROM " & strTablePrefix & "CONFIG "

				set rsInfo = my_Conn.Execute (StrSql)
				strVersion = rsInfo("C_STRVERSION")
				strSender = rsInfo("C_STRSENDER")

				rsInfo.Close
				set rsInfo = nothing

				if strVersion = "" then
					strSql = "SELECT C_VALUE "
					strSql = strSql & " FROM " & strTablePrefix & "CONFIG_NEW "
					strSql = strSql & " WHERE C_VARIABLE = 'strVersion' "
					set rsInfo = my_Conn.Execute (StrSql)
					strVersion = rsInfo("C_VALUE")
					rsInfo.Close
					set rsInfo = nothing

					strSql = "SELECT C_VALUE "
					strSql = strSql & " FROM " & strTablePrefix & "CONFIG_NEW "
					strSql = strSql & " WHERE C_VARIABLE = 'strSender' "
					set rsInfo = my_Conn.Execute (StrSql)
					strSender = rsInfo("C_VALUE")
					rsInfo.Close
					set rsInfo = nothing
				end if

				my_Conn.Close
				set my_Conn = nothing

				Response.Redirect "setup.asp?RC=2&MAIL=" & Server.UrlEncode(strSender) & "&VER=" & Server.URLEncode(strVersion) & "&strDBType="& strDBType & "&EC=" & ConnErrorNumber
			else
				my_Conn.Errors.Clear
				blnLoadConfig = FALSE
			end if

		end if
	next

	my_Conn.Errors.Clear

	if blnLoadConfig then
		Application.Lock
		do while not rsConfig.EOF
			Application(strCookieURL & Trim(UCase(rsConfig("C_VARIABLE")))) = Trim(rsConfig("C_VALUE"))
			rsConfig.MoveNext
		loop
		Application.UnLock
		rsConfig.close
	end if

	my_Conn.Close
	set my_Conn = nothing

	on error goto 0
	Application.Lock
	Application(strCookieURL & "ConfigLoaded")= "YES"
	Application.UnLock
End If

Permalänk: https://www.webforum.nu/p/1588219

## #20 — Sjodahl, 2005-04-06T19:29Z

hmm du bör väl ändra:

strConnString = "driver={MySQL ODBC 3.51 Driver};option=4;server=localhost;user=username;password=pas
sword;DATABASE=databasnamn;" '

Du bör väl sätta dessa värdena?
username
åassword
databasnamn

Permalänk: https://www.webforum.nu/p/1588250

---

Tråden på webben: https://www.webforum.nu/amne/asp/125671-någon-som-vill-hjälpa-med-koden  
Nästa sida: https://www.webforum.nu/amne/asp/125671-någon-som-vill-hjälpa-med-koden/page2.md
