Uploading and querying an mdb file
Hi , I was wondering if it was possible uploading an mdb file and parsing it to output a pdf file through cf...
I know I have therefor need to have a dsn-less connection to that file to start with.
I tried :
<cfif isdefined("form.fileData")>
<cfscript>
hello = FileUpload("C:\inetpub\wwwroot\cvt\","form.fileData","application/msaccess","MakeUnique");
</cfscript>
<cfdump var="#hello#">
<cfscript>
classLoader = createObject("java", "java.lang.Class");
classLoader.forName("sun.jdbc.odbc.JdbcOdbcDriver");
dm = createObject("java","java.sql.DriverManager");
con = dm.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};Dbq=#hello.serverfile#;Uid=Admin;Pwd=somepwd;");
st = con.createStatement();
rs = st.ExecuteQuery("Select * FROM tblbarcode");
q = createObject("java", "coldfusion.sql.QueryTable").init(rs);
//the query is stored in the variable q
</cfscript>
<cfquery name="GetExample" datasource="q" dbtype="query">
Select *
From tblbarcode
</cfquery>
<cfdump var="#GetExample#">
<cfelse>
<cfform name="myUpload" enctype="multipart/form-data">
<cfinput type="file" name="fileData"><br>
<cfinput type="submit" name="submit" value="Verzenden">
</cfform>
</cfif>
and i get :
No suitable driver found for Driver={Microsoft Access Driver (*.mdb)};Dbq=stockwagen15.mdb;Uid=Admin;Pwd=somepwd;
If i change jdbc:odbc:DRIVER to Driver , I get
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I also tried using a complete path to the file, same error ...
