Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Whats Wrong?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

asp_storm
Average Member

USA
787 Posts

Posted - 06 April 2002 :  16:08:49  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
with this code?

<%
Dim ID
Dim Trick
Trick= request.form("Trick")
Dim Skier
Skier= request.form("skier")
Dim url
url=request.form("url")
Dim Photog
Photog= request.form("photog")
Dim connn
connn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\conntomydatabase"
Dim con
If Len(request.form("File1")) > 0 Then
response.redirect("/inserta.asp")
Else
sql="INSERT INTO images (url,Trick,Skier,Photog) values('" & url & "','"& Trick &"','"& Skier &"','" & Photog & "')"
End If
con.Open connn
con.Execute sql
con.Close
Set con= Nothing
%>

what i am trying to do is see if a user has decided to upload a file insted of adding a url to it. i am using Asp SimpleUpload and.
ps:
i get this error:
quote:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/insert.asp, line 19


thanks



@tomic
Senior Member

USA
1790 Posts

Posted - 06 April 2002 :  16:24:28  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Try this. All I added was:

set con = Server.CreateObject("ADODB.Connection")


<%Dim ID
Dim Trick
Trick= request.form("Trick")
Dim Skier
Skier= request.form("skier")
Dim urlurl=request.form("url")
Dim PhotogPhotog= request.form("photog")
Dim connn
connn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\conntomydatabase"
Dim con
set con = Server.CreateObject("ADODB.Connection")
If Len(request.form("File1")) > 0 Then
response.redirect("/inserta.asp")
Else
sql="INSERT INTO images (url,Trick,Skier,Photog) values('" & url & "','"& Trick &"','"& Skier &"','" & Photog & "')"
End If

con.Open connn
con.Execute sql

con.Close
Set con= Nothing
%>


http://www.skepticfriends.org
Go to Top of Page

asp_storm
Average Member

USA
787 Posts

Posted - 06 April 2002 :  16:31:21  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
ok..i did that..now i get this error:
quote:

Microsoft JET Database Engine error '80004005'

Field 'images.Url' cannot be a zero-length string.

/insert.asp, line 23



line 23:

con.Execute sql





Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 06 April 2002 :  16:34:58  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
have you tried response.write sql before you try to execute it so you can see what you are trying to pass?

@tomic

http://www.skepticfriends.org
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 06 April 2002 :  16:37:56  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
I assume you are using Access so nevermind my previous post and open Access, view the table in design view and change images.Url to Allow Zero Length: Yes

@tomic

http://www.skepticfriends.org

Edited by - @tomic on 06 April 2002 16:38:34
Go to Top of Page

asp_storm
Average Member

USA
787 Posts

Posted - 06 April 2002 :  16:38:03  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
no..but i will



Go to Top of Page

asp_storm
Average Member

USA
787 Posts

Posted - 06 April 2002 :  16:41:26  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
o..ok..lets see



Go to Top of Page

asp_storm
Average Member

USA
787 Posts

Posted - 06 April 2002 :  16:43:06  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
ok..i got it..thanks alot @tomic





Edited by - asp_newbie on 06 April 2002 16:43:30
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07