---
title: "Hjälp :-("
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/13282-hjälp"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "jboy_87"
published: "2001-12-19T15:52:00.000Z"
updated: "2001-12-19T20:26:00.000Z"
replies: 12
views: 317
page: 1
pages: 1
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/13282-hjälp"
---

# Hjälp :-(

## #1 — jboy_87, 2001-12-19T15:52Z

vad är det för fel på koden!!!

```

<%
On Error Resume Next

'  Variables
'  *********
   Dim mySmartUpload
   Dim file
   Dim oConn
   Dim oRs
   Dim intCount
   Dim ConnectString, conn
   Dim ID
   intCount=0
        
'  Object creation
'  ***************
   Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
   mySmartUpload.AllowedFilesList = "jpg,gif"
   mySmartUpload.MaxFileSize = 500000
'  Upload
'  ******
   mySmartUpload.Upload

'  Connect to the DB
'  *****************
   Set oConn = Server.CreateObject("ADODB.Connection")
   pictures = Server.MapPath("siteusers.mdb")
   oConn.Open "DBQ="& pictures &";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;"

'ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("etellerandet.mdb")
'Set conn = Server.CreateObject("ADODB.Connection")

'conn.open ConnectString," & pictures & "
'DBQ="& pictures &";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;"

'  Open a recordset
'  ****************
   strSQL = "SELECT FILENAME,FILE,username,ID FROM users WHERE username = '" & username & "'"

   Set oRs = Server.CreateObject("ADODB.recordset")
   Set oRs.ActiveConnection = oConn
   oRs.Source = strSQL
   oRs.LockType = 3
   oRs.Open

'  Select each file
'  ****************
   For each file In mySmartUpload.Files
   '  Only if the file exist
   '  **********************
      If not file.IsMissing Then

      '  Add the current file in a DB field
      '  **********************************
         
	 oRs.Update
	 
         file.FileToField oRs.Fields("FILE")
		 oRs("FILENAME") = username &  file.FileName
         oRs.Update
         file.SaveAs("d:\hjemmeside\pictures\" &   username   & file.filename)
	 intCount = intCount + 1
      End If
   Next

'  Display the number of files uploaded
'  ************************************
   Response.Write(intCount & " file(s) uploaded.<BR>")
   
'  Destruction
'  ***********
   oRs.Close
   oConn.Close
   Set oRs = Nothing 
   Set oConn = Nothing 

If Err Then
      Response.Write("<b>Your Picture is of the wrong kind of type please go back and correct the problem: Only .Jpg and .Gif is allowed !If your think its webmaster´s failure then mail him att: <a href='mailto:webmaster@d-soft.dk?subject=LOGIN FAILURE'><h3>WEBMASTER</h3> </b><br><a href='javascript:self.history.go(-1)'><b><font color='red' font size='2'>Please go back and try again</b></font>" )
else
	Response.write ("<b><font size ='2' font color='blue'>Youe have uploaded your picture with success please click below to enter your profile</b></font><br><a href=profile.asp><b><font color='red' font size='2'>Back to profile :-)</b></font>")
	
end if
	

'Response.Redirect("profil.asp?updated=true")
%>
```

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

## #2 — emission, 2001-12-19T15:57Z

Ehrm...vad går snett?

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

## #3 — cyprys, 2001-12-19T15:57Z

Vore trevligt om du berättade vad felet är först.

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

## #4 — icaaq, 2001-12-19T15:58Z

Vad får du för felmedelande?

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

## #5 — jboy_87, 2001-12-19T15:59Z

0 file(s) uploaded.
Your Picture is of the wrong kind of type please go back and correct the problem: Only .Jpg and .Gif is allowed !If your think its webmaster´s failure then mail him att:

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

## #6 — cyprys, 2001-12-19T16:01Z

Ta bort On Error resume next och säg om den säger något vettigt då

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

## #7 — jboy_87, 2001-12-19T17:43Z

nu får jag detta:

aspSmartUpload (0x800A0035)
File not found: aspsmartuploadutil.dll
/communities/dating system/Sample.asp, line 24

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

## #8 — jboy_87, 2001-12-19T18:05Z

när jag tog bort on error resume next

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

## #9 — jboy_87, 2001-12-19T18:39Z

har fixat skiten!!!

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

## #10 — icaaq, 2001-12-19T19:15Z

Det är bra om du skriver hur du gjorde så andra kan lära sig av dina misstag ;)

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

## #11 — jboy_87, 2001-12-19T19:30Z

hahaha okej registrerade aspuploadutil.dll

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

## #12 — jboy_87, 2001-12-19T20:21Z

hur får jag det hära och bli så här i databasen 
Bilder/medlemmar/bla bla.hkjhjh

\[Redigerat av jboy_87 den 19 dec 2001\]

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

## #13 — jboy_87, 2001-12-19T20:26Z

har fixat

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/13282-hjälp
