Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    percorso database, cosa inserisco ?

    questa volta non capisco dove sbaglio, mi da questo errore:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    /public/fotogallery/index.asp, line 47


    il codice in questione è sotto riportato in rosso, ma dove devo inserire il percorso del database, che è: /mdb-database/fotogallery/database.mdb


    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' HTTP="false"
    ' Catalog=""
    ' Schema=""
    MM_ConAlbum_STRING = "dsn=album;uid=;pwd=;"

    %>



    Grazie !!!

  2. #2
    codice:
    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' HTTP="false"
    ' Catalog=""
    ' Schema=""
    MM_ConAlbum_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.mapPath("/mdb-database/fotogallery/database.mdb")
    
    %>

  3. #3
    ho risolto così:

    MM_ConAlbum_STRING ="driver={Microsoft Access Driver (*.mdb)}; dbq=" & Server.MapPath ("/mdb-database/fotogallery/album.mdb")


    ora funzia tutto tranne l'upload immagini, mi compare questa scritta:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver] Field 'tbl_album.fld_height' cannot be a zero-length string.

    /public/fotogallery/photo_upload.asp, line 153


    cos'è ?

    Se vuoi ecco il link http://www.lidoborrelli.com/public/f...lery/index.asp
    registrati pure e fai tutte le prove, è in fase di test

    Grazie

  4. #4
    Capisci l'inglese?
    Field 'tbl_album.fld_height' cannot be a zero-length string.
    Il campo 'tbl_album.fld_height' non può contenere una stringa di lunghezza-zero.
    Questo perchè nelle proprietà della tabella l'hai settato obbligatorio.

  5. #5
    ECCO LA PAGINA IN QUESTIONE, NON CAPISCO DOVE METTERCI LE MANI PERO'


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>



    <% If session("MM_Username")= "" Then
    response.redirect("incorrect_login.asp")
    end if
    %>

    <%
    '*** Pure ASP File Upload 2.1.7
    Dim GP_uploadAction,UploadQueryString
    PureUploadSetup
    If (CStr(Request.QueryString("GP_upload")) <> "") Then
    Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,p au_storeType,pau_sizeLimit,pau_nameConflict,pau_re quireUpload,pau_minWidth,pau_minHeight,pau_maxWidt h,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_t imeout,pau_progressBar,pau_progressWidth,pau_progr essHeight
    pau_thePath = """images/"" & Session(""MM_Username"")"
    pau_Extensions = "GIF,JPG,JPEG,BMP,PNG,PGM,TGA,TIFF,PCX"
    pau_Form = "MyForm"
    pau_Redirect = ""
    pau_storeType = "file"
    pau_sizeLimit = ""
    pau_nameConflict = "uniq"
    pau_requireUpload = "true"
    pau_minWidth = "300"
    pau_minHeight = "300"
    pau_maxWidth = "1400"
    pau_maxHeight = "1400"
    pau_saveWidth = "width"
    pau_saveHeight = "height"
    pau_timeout = "600"
    pau_progressBar = "coolGreenFlashProgress.htm"
    pau_progressWidth = "310"
    pau_progressHeight = "125"

    Dim RequestBin, UploadRequest
    CheckPureUploadVersion 2.17
    ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeT ype,pau_sizeLimit,pau_nameConflict,pau_requireUplo ad,pau_minWidth,pau_minHeight,pau_maxWidth,pau_max Height,pau_saveWidth,pau_saveHeight,pau_timeout
    end if
    %>

    <%
    ' *** Edit Operations: (Modified for File Upload) declare variables

    Dim MM_editAction
    Dim MM_abortEdit
    Dim MM_editQuery
    Dim MM_editCmd

    Dim MM_editConnection
    Dim MM_editTable
    Dim MM_editRedirectUrl
    Dim MM_editColumn
    Dim MM_recordId

    Dim MM_fieldsStr
    Dim MM_columnsStr
    Dim MM_fields
    Dim MM_columns
    Dim MM_typeArray
    Dim MM_formVal
    Dim MM_delim
    Dim MM_altVal
    Dim MM_emptyVal
    Dim MM_i

    MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
    If (UploadQueryString <> "") Then
    MM_editAction = MM_editAction & "?" & UploadQueryString
    End If

    ' boolean to abort record edit
    MM_abortEdit = false

    ' query string to execute
    MM_editQuery = ""
    %>
    <%
    ' *** Insert Record: (Modified for File Upload) set variables

    If (CStr(UploadFormRequest("MM_insert")) = "MyForm") Then

    MM_editConnection = MM_ConAlbum_STRING
    MM_editTable = "tbl_album"
    MM_editRedirectUrl = "photo_upload_post.asp"
    MM_fieldsStr = "title|value|private|value|detail|value|FILE|value |owner|value|width|value|height|value"
    MM_columnsStr = "fld_title|',none,''|fld_private_pic|none,1,0|fld_ detail|',none,''|fld_pic_original|',none,''|fld_ow ner|',none,''|fld_width|',none,''|fld_height|',non e,''"

    ' create the MM_fields and MM_columns arrays
    MM_fields = Split(MM_fieldsStr, "|")
    MM_columns = Split(MM_columnsStr, "|")

    ' set the form values
    For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(UploadFormRequest(MM_fields(MM_i)))
    Next

    ' append the query string to the redirect URL
    If (MM_editRedirectUrl <> "" And UploadQueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
    MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
    Else
    MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
    End If
    End If

    End If
    %>
    <%
    ' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it

    Dim MM_tableValues
    Dim MM_dbValues

    If (CStr(UploadFormRequest("MM_insert")) <> "") Then

    ' create the sql insert statement
    MM_tableValues = ""
    MM_dbValues = ""
    For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
    MM_formVal = MM_emptyVal
    Else
    If (MM_altVal <> "") Then
    MM_formVal = MM_altVal
    ElseIf (MM_delim = "'") Then ' escape quotes
    MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
    Else
    MM_formVal = MM_delim + MM_formVal + MM_delim
    End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
    MM_tableValues = MM_tableValues & ","
    MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
    Next
    MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"

    If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute


    If (MM_editRedirectUrl <> "") Then
    ' Response.Redirect(MM_editRedirectUrl)
    End If
    End If

    End If
    %>
    <%

    If (CStr(UploadFormRequest("MM_insert")) <> "") Then
    Set rsGetID = Server.CreateObject("ADODB.Recordset")
    rsGetID.ActiveConnection = MM_editCmd.ActiveConnection
    rsGetID.Source = "SELECT max(ID) as MaxID FROM tbl_album"
    rsGetID.CursorType = 0
    rsGetID.CursorLocation = 2
    rsGetID.LockType = 1
    rsGetID.Open()
    Session("svUploadID")=rsGetID("MaxID")
    Response.Redirect(MM_editRedirectUrl)
    end if
    %>
    <%
    Dim strUserAgent 'Holds info on the users browser and os
    Dim strBrowserUserType 'Holds the users browser type

    'Get the users HTTP user agent (web browser)
    strUserAgent = Request.ServerVariables("HTTP_USER_AGENT")


    'Internet Explorer
    If inStr(1, strUserAgent, "MSIE 6.0", 1) Then
    strBrowserUserType = "IE"
    ElseIf inStr(1, strUserAgent, "MSIE 5", 1) Then
    strBrowserUserType = "IE"
    ElseIf inStr(1, strUserAgent, "MSIE 4", 1) Then
    strBrowserUserType = "IE"
    ElseIf inStr(1, strUserAgent, "MSIE 3", 1) Then
    strBrowserUserType = "IE"

    'Netscape and Mozilla
    ElseIf inStr(1, strUserAgent, "Gecko/20030", 1) OR inStr(1, strUserAgent, "Netscape/7", 1) Then
    strBrowserUserType = "Netscape"
    ElseIf inStr(1, strUserAgent, "Mozilla/5", 1) OR inStr(1, strUserAgent, "Netscape6", 1) Then
    strBrowserUserType = "Netscape"
    ElseIf inStr(1, strUserAgent, "Mozilla/4", 1) Then
    strBrowserUserType = "Netscape"
    ElseIf inStr(1, strUserAgent, "Mozilla/3", 1) Then
    strBrowserUserType = "Netscape"

    'Else unknown or robot
    Else
    strBrowserUserType = "Unknown"
    End If

    'Return function
    BrowserType = strBrowserUserType

    Session("BrowserType") = BrowserType

    %>



    <html>
    <head>
    <title>photo Album </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="assets/style_sheets/css.css" rel="stylesheet" type="text/css">
    <script language="javascript" src="ScriptLibrary/incPureUpload.js"></script>
    <script language="javascript" src="ScriptLibrary/scripts.js"></script>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function previewImage(fileInfo) {
    var filename = "";
    //create the path to your local file
    if (fileInfo == null) {
    if (document.MyForm.FILE != "") {
    filename = "file:///" + document.MyForm.FILE.value;
    }
    } else {
    filename = fileInfo;
    }
    //check if there is a value
    if (filename == "") {
    alert ("Please select a image.");
    document.MyForm.FILE.focus();
    } else {
    //create the popup
    popup = window.open('', 'imagePreview', 'width=600,height=450,left=100,top=75,screenX=100, screenY=75,scrollbars,resizable=1');
    //start writing in the html code
    popup.document.writeln("<html><title>preview </title><body bgcolor='#ffffff'>");
    //get the extension of the file to see if it has one of the image extensions
    var fileExtension = filename.substring(filename.lastIndexOf(".")+1);
    if (fileExtension == "jpg" || fileExtension == "jpeg" || fileExtension == "gif" || fileExtension == "bmp"
    || fileExtension == "png")
    popup.document.writeln("[img]" + filename + "[/img]");
    else
    //if not extension fron list above write URL to file
    popup.document.writeln("" + filename + "");
    popup.document.writeln("</body></html>");
    popup.document.close();
    popup.focus();
    }
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_validateForm() { //v4.0
    var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
    if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
    if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
    } else if (test!='R') { num = parseFloat(val);
    if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
    if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
    min=test.substring(8,p); max=test.substring(p+1);
    if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
    }
    //-->
    </script>



    <style type="text/css">
    <!--
    body {
    margin-top: 25px;
    margin-bottom: 25px;
    }
    -->
    </style></head>

    <body >
    <FORM ACTION="<%=MM_editAction%>" METHOD="POST" ENCTYPE="multipart/form-data" name="MyForm" id="MyForm" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,P NG,PGM,TGA,TIFF,PCX',true,'',300,300,1200,1200,'wi dth','height');showProgressWindow('coolGreenFlashP rogress.htm',310,125);return document.MM_returnValue" >
    <table width="426" border="0" align="center">
    <tr>
    <td colspan="3" class="Buttons"><div align="center">
    <table width="99%" border="0" class="cellover">
    <tr>
    <td><div align="center">Now you can upload JPEG, JPE, GIF, BMP, TIFF and PNG files

    with the following dimensions can be uploaded:

    Min. Width:300 px, Min. Height:300 px

    Max. Width: 1400px, Max. Height: 1400 px</div></td>
    </tr>
    </table>
    </div></td>
    </tr>
    <tr >
    <td width="56" class="cellover"><div align="right"> Title:</div></td>
    <td width="214" class="cellover"><input name="title" type="text" class="Buttons" id="title2" value="Title Please??" size="35">
    </td>
    <td width="142" class="cellover"><div align="center">private Pic:
    <input name="private" type="checkbox" id="private" value="checkbox" class="cellover">
    </div></td>
    </tr>
    <tr >
    <td class="cellover" colspan="3"><div align="center">PIC Description
    </div></td>
    </tr>
    <tr >
    <td class="cellover" colspan="3"><div align="center">
    <textarea name="detail" cols="45" rows="5" id="detail" class="Buttons">PIC Description</textarea>
    </div></td>
    </tr>
    <tr>
    <td colspan="3" class="cellover"><div align="center">
    <INPUT NAME="FILE" TYPE="FILE" class="Buttons" id="FILE3" SIZE="40" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BM P,PNG',true,'',300,300,1200,1200,'width','height') ">
    <% If Session("BrowserType") = "IE" Then %>
    <input name="Button" type="button" id="Button" value="Preview" class="Buttons" ONCLICK="previewImage(document.MyForm.FILE.value)" >
    <% End If %>
    </div></td>
    </tr>
    <tr>
    <td colspan="3" class="cellover"><div align="center">
    <input name="Submit" type="submit" class="Buttons" onClick="MM_validateForm('title2','','R','detail', '','R');return document.MM_returnValue" value="Upload">
    </div></td>
    </tr>
    </table>
    <input name="owner" type="hidden" id="owner" value="<%= Session("MM_Username") %>">
    <input name="width" type="hidden" id="width">
    <input name="height" type="hidden" id="height">
    <input type="hidden" name="MM_insert" value="MyForm">
    </FORM>


    </body>
    </html>

  6. #6
    Il problema è nella tabella del db e non nel codice.
    Ciao.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.