Bqvnvucofchwq
New Member
'Create a connection string <BR> Dim connString as String <BR> connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=\premfs4sitespremium9eliasondatabaseevents. mdb" <BR>'Open a connection <BR> Dim objConnection as OleDbConnection = New OleDbConnection(connString) <BR><BR> objConnection.Open() <BR><BR>ALSO Here is the entire page maybe someone can see something else wrong<BR><BR><%@ Page Language="vb" %> <BR><script runat="server"> <BR>Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load <BR> If (Me.IsPostBack) Then Me.SaveImages() <BR>End Sub <BR><BR>Private Function SaveImages() As System.Boolean <BR> 'loop through the files uploaded <BR> Dim colFiles As System.Web.HttpFileCollection = System.Web.HttpContext.Current.Request.Files <BR><BR> 'Message to the user <BR> Dim strMessage As New System.Text.StringBuilder("Files Uploaded:<BR><BR>") <BR> Dim intFileCntr As System.Int32 <BR>Try <BR><BR> For intFileCntr = 0 To colFiles.Count - 1 <BR><BR> Dim objCurrentFile As System.Web.HttpPostedFile = colFiles(intFileCntr) <BR> Dim strCurrentFileName, strCurrentFileExtension As System.String <BR><BR> strCurrentFileName = System.IO.Path.GetFileName(objCurrentFile.FileName ) <BR><BR> If strCurrentFileName <> "" Then <BR> <BR> strCurrentFileExtension = System.IO.Path.GetExtension(strCurrentFileName) <BR><BR> If (strCurrentFileExtension = ".gif") Then <BR><BR> 'Save File to the proper directory <BR> objCurrentFile.SaveAs("\premfs4sitespremium9eliasonwebrootimages\" + strCurrentFileName) <BR><BR> strMessage.Append(strCurrentFileName + " successfully uploaded.<BR>") <BR><BR> ElseIf (strCurrentFileExtension = ".jpg") Then <BR><BR> 'Save File to the proper directory <BR> objCurrentFile.SaveAs("\premfs4sitespremium9eliasonwebrootimages\" + strCurrentFileName) <BR><BR> strMessage.Append(strCurrentFileName + " successfully uploaded.<BR>") <BR><BR> Else <BR> strMessage.Append(strCurrentFileName & " <font color=""red"">failed!! Only .gif and .jpg images allowed!</font> <BR>") <BR> End If <BR> End If <BR> Next <BR><BR> Label1.Text = strMessage.ToString() <BR> Return True <BR>Catch Ex As System.Exception <BR> Label1.Text = Ex.Message <BR> Return False <BR>End Try <BR><BR>End Function <BR><BR>'Create a connection string <BR> Dim connString as String <BR> connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=\premfs4sitespremium9eliasondatabaseevents. mdb" <BR>'Open a connection <BR> Dim objConnection as OleDbConnection = New OleDbConnection(connString) <BR><BR> objConnection.Open() <BR><BR><BR><BR><BR><BR></script><BR><BR><!-- #include file="header.asp" --><BR><form id="UPLOAD" method="post" runat="server" enctype="multipart/form-data"> <BR><h3>Image Uploader</h3> <BR><table><BR><tr><BR> <td><BR> <INPUT type="file" runat="server" size="50" ID="File1" NAME="File1"><BR> </td><BR></tr><BR><tr><BR> <td><BR> <INPUT type="file" runat="server" size="50" ID="File2" NAME="File2"><BR> </td><BR></tr><BR><tr><BR> <td><BR> <INPUT type="file" runat="server" size="50" ID="File3" NAME="File3"><BR> </td><BR></tr><BR><tr><BR> <td><BR> <INPUT type="file" runat="server" size="50" ID="File4" NAME="File4"><BR> </td><BR></tr><BR><tr><BR> <td><BR> <INPUT type="file" runat="server" size="50" ID="File5" NAME="File5"><BR> </td><BR></tr><BR><tr><BR> <td><BR><asp:LinkButton id="LinkButton1" runat="server" Font-Names="Verdana" Font-Bold="True" Font-Size="XX-Small">Upload Images</asp:LinkButton><BR> <A href="javascript:document.forms[0].reset()" id="LinkButton2" style="FONT-WEIGHT:bold;FONT-SIZE:xx-small;FONT-FAMILY:verdana">Reset Form</A><BR><asp:Label id="Label1" runat="server" Font-Names="verdana" Font-Bold="True" Font-Size="XX-Small" Width="400px" BorderStyle="None" BorderColor="White"></asp:Label><BR></td><BR></tr><BR></table><BR></form> <BR></td></tr> <BR><!-- #include file="footer.asp" --> <BR><BR><BR>please help mikeI dunno if you can use a UNC in there. Try moving the dB on to the same physical disk as the application and then try it. If it works, you may have to change some security contexts so that you can map w/a physical drive letter. If it still doesn't work, it must be something else.<BR><BR>Course I could be wrong...