Server Time:
Sunday May 11 2008 08:05 PM  
Your Time:
  
HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

DSN-less Connection to Access / Uploading documents
by: Steve Moore
Email this tutorial to a friend Display Printer Friendly Format
[Download in PDF Format] [Download in FlashPaper Format]

The following code shows how to upload a file to a web directory and write that directory to an Access database.

Keep in mind that this is for users that are on a PRE-MX (ColdFusion 5.0) environment. CFMX does not currently allow for DNS-Less connections, due to a "restriction" with JDBC.

 

If the file exists, then upload it to the server and process the request.
<cfif FORM.uploadedFile NEQ ''>
    <CFFILE ACTION=
"upload"
                FILEFIELD=
"uploadedFile"
                DESTINATION=
"d:\Inetpub\wwwroot\ccm\intranet\ccm\documents\upload\"
                NAMECONFLICT=
"MAKEUNIQUE">


    <cfset upload_file = file.serverfile>

    <cfoutput>

      #serverFile# successfully added.
      Size of the uploaded file: #Numberformat(Evaluate(File.FileSize/1024))# KB.
    </cfoutput>

    <br>

    <cfset DBPath="d:\Inetpub\wwwroot\ccm\intranet\ccm\documents\Uploads.mdb">
    <cfquery name=
"test"
                 datasource="#DBPath#"
                 dbtype=
"OLEDB"
                 provider=
"Microsoft.Jet.OLEDB.4.0"
                 providerdsn=
"#DBPath#"
                 username=
"Admin"
                 password=
"">

        INSERT INTO document (documentName)
        VALUES ('d:\Inetpub\wwwroot\ccm\intranet\ccm\documents\upload\#upload_file#')

    </cfquery>
</cfif>


Date added: Mon. September 15, 2003
Posted by: Steve Moore | Views: 10260 | Tested Platforms: CF5 | Difficulty: Intermediate
Categories Listed: Databases

HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

Please rate this tutorial:
5 Stars 4 Stars 3 Stars 2 Stars 1 Stars
Comments on this tutorial
Read previous comments on this particular tutorial
mobilephone housing
mobilephone housine for nokia 1100 2100 2112 3100 3120 3200 3220 3315 6100 6610 7210 7250 7260 7610 8210 8250 8310 moto v180 v220 c330 c350 v300 v400 siemens mc60 m55 m50 a50 a55 c55 c45 samsung ect
,mobilephone lcd ,case ,strip.
Posted by: mobilephone housing
Posted on: 03/19/2005 02:01 AM
Post a new comment on this tutorial
post a new comment on this particular tutorial
Your Name:
Your Email:
Comment Title:
Comments:
Key Phrase:
 
Skyscrapper Banner Advertisement
ColdFusion Hosting by HostMySite

You are 1 of 615 active sessions! | Privacy | Company
Copyright © 2002 EasyCFM.Com, LLC. (Easy ColdFusion Tutorials) All Rights Reserved
All other trademarks and copyrights are the property of their respective holders.
ColdFusion Hosting ColdFusion Hosting
ADD TO:
Blink
Del.icio.us
Digg
Furl
Google
Simpy
Spurl
Y! MyWeb