|
|
|
start date: Wed, 08 Aug 2007 02:45:44 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
slinky
|
|
2
Mick Walker
|
|
3
slinky
|
|
4
slinky
|
|
5
Mick Walker
|
|
6
Göran Andersson
|
|
7
Göran Andersson
|
|
8
Göran Andersson
|
|
9
slinky
|
|
10
slinky
|
|
11
Göran Andersson
|
|
12
slinky
|
|
13
slinky
|
|
14
Alexey Smirnov
|
problem with .aspx.vb code
I'm working on a problem with a form with 6 textboxes and a submit
button for adding data to an Access database.I changed a few things
and got it down to 1 error!. I have a Sub
Page_Load and a Sub btnAdd:
(It still doesn't like the 'SourceVersion' in the Sub Page_Load).
Also
I viewed the .aspx in the browser and got an error which I posted
complete at the bottom of this post). Thanks for any clues... I'm
almost there!!
Imports System.Data
Imports System.Data.OleDb
Public Class Default5
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim cnn As OleDbConnection = _
New OleDbConnection("Data Source=(local);" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
If IsPostBack Then
Dim cmdSelect As OleDbCommand = _
cnn.CreateCommand()
cmdSelect.CommandType = CommandType.Text
cmdSelect.CommandText = _
"SELECT (Asset Number, Description, Serial_Number, Mfg, Asset Type,
RDCnumber) FROM Assets"
Dim cmdInsert As OleDbCommand = _
cnn.CreateCommand()
cmdInsert.CommandType = CommandType.Text
cmdInsert.CommandText = _
"INSERT INTO Assets " & _
"(Asset Number, Description, Serial_Number, Mfg, Asset Type,
RDCnumber) " & _
"VALUES(@Asset_Number, @Description, @Serial_Number, @Mfg,
@AssetType,
@RDCnumber"
cmdInsert.Parameters.Add("@txtAsset_Number",
OleDbType.Double, 12, "Asset_Number")
cmdInsert.Parameters.Add("@txtDescription",
OleDbType.WChar, 40, "Description")
cmdInsert.Parameters.Add("@txtSerial_Number",
OleDbType.WChar, 30, "Serial_Number")
cmdInsert.Parameters.Add("@txtMfg", OleDbType.WChar, 30,
"Mfg")
cmdInsert.Parameters.Add("@txtAssetType",
OleDbType.WChar,
30, "AssetType")
cmdInsert.Parameters.Add("@txtRDCNumber",
OleDbType.WChar,
30, "RDCnumber")
Dim SourceVersion As DataRowVersion
SourceVersion = DataRowVersion.Original
da.SelectCommand = cmdSelect
da.InsertCommand = cmdInsert
da.Fill(ds, "Assets")
End If
End Sub
Private Sub btnAdd_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd.Click
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
Dim dr As DataRow = ds.Tables("Assets").NewRow()
dr(0) = txtAsset_Number.Text
dr(1) = txtDescription.Text
dr(2) = txtSerial_Number.Text
dr(3) = txtMfg.Text
dr(4) = txtAssetType.Text
dr(5) = txtRDCnumber.Text
ds.Tables("Assets").Rows.Add(dr)
da.Update(ds, "Assets")
End Sub
End Class
__________________________
Server Error in '/' Application.
--------------------------------------------------------------------------------
An OLE DB Provider was not specified in the ConnectionString. An
example would be, 'Provider=SQLOLEDB;'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.ArgumentException: An OLE DB Provider was
not specified in the ConnectionString. An example would be,
'Provider=SQLOLEDB;'.
Source Error:
Line 5: Private Sub Page_Load(ByVal sender As System.Object, _
Line 6: ByVal e As System.EventArgs) Handles MyBase.Load
Line 7: Dim cnn As OleDbConnection = _
Line 8: New OleDbConnectio
Date:Wed, 08 Aug 2007 02:45:44 -0700
Author:
|
Re: problem with .aspx.vb code
<snip>
>
> Imports System.Data
> Imports System.Data.OleDb
> Public Class Default5
> Inherits System.Web.UI.Page
> Private Sub Page_Load(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles MyBase.Load
> Dim cnn As OleDbConnection = _
> New OleDbConnection("Data Source=(local);" & _
> "Initial Catalog=Assets;Integrated Security=SSPI")
> Dim ds As DataSet = New DataSet()
</snip>
Try
Dim cnn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=(local);
Initial Catalog=Assets;Integrated Security=SSPI")
But this still wont work, because as far as I can see, you dont set the
path to the access file anywhere.
Date:Wed, 08 Aug 2007 11:09:40 +0100
Author:
|
Re: problem with .aspx.vb code
The database resides in the App_Data folder on my web provider's
server where my website objects reside. Do I need to put the path to
the URL? Thanks!
>
> But this still wont work, because as far as I can see, you dont set the
> path to the access file anywhere.
Date:Wed, 08 Aug 2007 05:07:46 -0700
Author:
|
Re: problem with .aspx.vb code
I changed the filepath and was able to get it to have no errors. But
when I ran my .aspx file I got the following error shown below my
code. Is the line "If IsPostBack" an issue? Thanks
Imports System.Data
Imports System.Data.OleDb
Public Class Default5
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim cnn As OleDbConnection = _
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=(www.juggernautical.com\App_Data\Lowes.mdb);" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
If IsPostBack Then
Dim cmdSelect As OleDbCommand = _
cnn.CreateCommand()
cmdSelect.CommandType = CommandType.Text
cmdSelect.CommandText = _
"SELECT (Asset Number, Description, Serial_Number, Mfg, Asset Type,
RDCnumber) FROM Assets"
Dim cmdInsert As OleDbCommand = _
cnn.CreateCommand()
cmdInsert.CommandType = CommandType.Text
cmdInsert.CommandText = _
"INSERT INTO Assets " & _
"(Asset Number, Description, Serial_Number, Mfg, Asset Type,
RDCnumber) " & _
"VALUES(@Asset_Number, @Description, @Serial_Number, @Mfg, @AssetType,
@RDCnumber"
cmdInsert.Parameters.Add("@txtAsset_Number",
OleDbType.Double, 12, "Asset_Number")
cmdInsert.Parameters.Add("@txtDescription",
OleDbType.WChar, 40, "Description")
cmdInsert.Parameters.Add("@txtSerial_Number",
OleDbType.WChar, 30, "Serial_Number")
cmdInsert.Parameters.Add("@txtMfg", OleDbType.WChar, 30,
"Mfg")
cmdInsert.Parameters.Add("@txtAssetType", OleDbType.WChar,
30, "AssetType")
cmdInsert.Parameters.Add("@txtRDCNumber", OleDbType.WChar,
30, "RDCnumber")
Dim SourceVersion As DataRowVersion
SourceVersion = DataRowVersion.Original
da.SelectCommand = cmdSelect
da.InsertCommand = cmdInsert
da.Fill(ds, "Assets")
End If
End Sub
Private Sub btnAdd_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd.Click
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
Dim dr As DataRow = ds.Tables("Assets").NewRow()
dr(0) = txtAsset_Number.Text
dr(1) = txtDescription.Text
dr(2) = txtSerial_Number.Text
dr(3) = txtMfg.Text
dr(4) = txtAssetType.Text
dr(5) = txtRDCnumber.Text
ds.Tables("Assets").Rows.Add(dr)
da.Update(ds, "Assets")
End Sub
End Class
_______________________________________________________________
Server Error in '/' Application.
--------------------------------------------------------------------------------
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Multiple-step OLE
DB operation generated errors. Check each OLE DB status value, if
available. No work was done.
Source Error:
Line 33: da.SelectCommand = cmdSelect
Line 34: da.InsertCommand = cmdInsert
Line 35: da.Fill(ds, "Assets")
Line 36: End If
Line 37: End Sub
Source File: E:\kunden\homepages\26\d190091667\Default5.aspx.vb
Line: 35
Stack Trace:
[OleDbException (0x80040e21): Multiple-step OLE DB operation generated
errors. Check each OLE DB status value, if available. No work was
done.]
System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString
constr, DataSourceWrapper& datasrcWrapper) +209
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString
constr, OleDbConnection connection) +118
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningObject) +53
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.OleDb.OleDbConnection.Open() +37
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable) +83
Default5.Page_Load(Object sender, EventArgs e) in E:\kunden
\homepages\26\d190091667\Default5.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1061
_______________________________
On Aug 8, 6:09 am, Mick Walker wrote:
> <snip>
>
> > Imports System.Data
> > Imports System.Data.OleDb
> > Public Class Default5
> > Inherits System.Web.UI.Page
> > Private Sub Page_Load(ByVal sender As System.Object, _
> > ByVal e As System.EventArgs) Handles MyBase.Load
> > Dim cnn As OleDbConnection = _
> > New OleDbConnection("Data Source=(local);" & _
> > "Initial Catalog=Assets;Integrated Security=SSPI")
> > Dim ds As DataSet = New DataSet()
>
> </snip>
> Try
>
> Dim cnn As OleDbConnection = New
> OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=(local);
> Initial Catalog=Assets;Integrated Security=SSPI")
>
> But this still wont work, because as far as I can see, you dont set the
> path to the access file anywhere.
Date:Wed, 08 Aug 2007 05:26:44 -0700
Author:
|
Re: problem with .aspx.vb code
slinky wrote:
> I changed the filepath and was able to get it to have no errors. But
> when I ran my .aspx file I got the following error shown below my
> code. Is the line "If IsPostBack" an issue? Thanks
>
>
>
Use Server.MapPath or try the reletive path to the data file.
Date:Wed, 08 Aug 2007 14:43:28 +0100
Author:
|
Re: problem with .aspx.vb code
I've used Server.MapPath with reading an XML file into a dataset, but
am unsure how to phrase it for an Access Database. What I used for XML
was:
Using ds As New DataSet()
ds.ReadXml(Server.MapPath("blog.xml"))
So I'm unsure where to go from here. Here's what I'm coming up with
for the Connection for Page_Load:
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=(Server.MapPath\App_Data\Lowes.mdb);" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
But do I need to do anything in the code for btnADD ?
Private Sub btnAdd_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd.Click
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
Dim dr As DataRow = ds.Tables("Assets").NewRow()
dr(0) = txtAsset_Number.Text
dr(1) = txtDescription.Text
dr(2) = txtSerial_Number.Text
dr(3) = txtMfg.Text
dr(4) = txtAssetType.Text
dr(5) = txtRDCnumber.Text
ds.Tables("Assets").Rows.Add(dr)
da.Update(ds, "Assets")
End Sub
I get no errors till I view in browser:
Source Error:
Line 33: da.SelectCommand = cmdSelect
Line 34: da.InsertCommand = cmdInsert
Line 35: da.Fill(ds, "Assets")
Line 36: End If
Line 37: End Sub
Line 35 is flagged in the browser as a problem.
On Aug 8, 9:43 am, Mick Walker wrote:
> slinky wrote:
> > I changed the filepath and was able to get it to have no errors. But
> > when I ran my .aspx file I got the following error shown below my
> > code. Is the line "If IsPostBack" an issue? Thanks
>
> Use Server.MapPath or try the reletive path to the data file.
Date:Wed, 08 Aug 2007 08:34:44 -0700
Author:
|
Re: problem with .aspx.vb code
slinky wrote:
> I've used Server.MapPath with reading an XML file into a dataset, but
> am unsure how to phrase it for an Access Database. What I used for XML
> was:
>
> Using ds As New DataSet()
> ds.ReadXml(Server.MapPath("blog.xml"))
>
> So I'm unsure where to go from here. Here's what I'm coming up with
> for the Connection for Page_Load:
>
> New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=(Server.MapPath\App_Data\Lowes.mdb);" & _
> "Initial Catalog=Assets;Integrated Security=SSPI")
Server.MapPath is a method, not a folder. It turns a virtual path into a
physical path, so you supply it with a virtual path. A virtual path uses
/, not \.
Use this to get the physical path to the database file:
Server.MapPath("~/App_Data/Lowes.mdb")
Concatenate this into the connection string.
> But do I need to do anything in the code for btnADD ?
>
> Private Sub btnAdd_Click( _
> ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles btnAdd.Click
> Dim ds As DataSet = New DataSet()
> Dim da As OleDbDataAdapter = New OleDbDataAdapter()
> Dim dr As DataRow = ds.Tables("Assets").NewRow()
> dr(0) = txtAsset_Number.Text
> dr(1) = txtDescription.Text
> dr(2) = txtSerial_Number.Text
> dr(3) = txtMfg.Text
> dr(4) = txtAssetType.Text
> dr(5) = txtRDCnumber.Text
> ds.Tables("Assets").Rows.Add(dr)
> da.Update(ds, "Assets")
> End Sub
You need to supply a database connection to the DataAdapter, otherwise
it doesn't know what to update.
> I get no errors till I view in browser:
> Source Error:
>
> Line 33: da.SelectCommand = cmdSelect
> Line 34: da.InsertCommand = cmdInsert
> Line 35: da.Fill(ds, "Assets")
> Line 36: End If
> Line 37: End Sub
>
> Line 35 is flagged in the browser as a problem.
What "problem"? You should include the error message.
--
Gran Andersson
_____
http://www.guffa.com
Date:Wed, 08 Aug 2007 18:43:22 +0200
Author:
|
Re: problem with .aspx.vb code
I put this into my doce for the Page_Load and the btnAdd:
Dim cnn As OleDbConnection = _
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Server.MapPath(~/App_Data/Lowes.mdb));" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
I get no errors till I launch the browser and here's the complete
message.
I see below what I believe to be the physical path on my provider's
server:
E:\kunden\homepages\26\d190091667\Default5.aspx.vb
The actual URL to access my site to the page 'Default5.aspx (not the
module) is:
www.juggernautical.com/default5.aspx
______________________________________________________________________________________________
Server Error in '/' Application.
---------------------------------------------------------------------------Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Multiple-step OLE
DB operation generated errors. Check each OLE DB status value, if
available. No work was done.
Source Error:
Line 33: da.SelectCommand = cmdSelect
Line 34: da.InsertCommand = cmdI
Date:Wed, 08 Aug 2007 11:14:15 -0700
Author:
|
Re: problem with .aspx.vb code
slinky wrote:
> I put this into my doce for the Page_Load and the btnAdd:
>
> Dim cnn As OleDbConnection = _
> New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=Server.MapPath(~/App_Data/Lowes.mdb));" & _
> "Initial Catalog=Assets;Integrated Security=SSPI")
>
> I get no errors till I launch the browser and here's the complete
> message.
> I see below what I believe to be the physical path on my provider's
> server:
>
> E:\kunden\homepages\26\d190091667\Default5.aspx.vb
>
> The actual URL to access my site to the page 'Default5.aspx (not the
> module) is:
> www.juggernautical.com/default5.aspx
>
> ______________________________________________________________________________________________
>
> Server Error in '/' Application.
> --------------------------------------------------------------------------------
>
> Multiple-step OLE DB operation generated errors. Check each OLE DB
> status value, if available. No work was done.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
Your select query is incorrect. If you have spaces in your field names,
you have to encode the names in brackets.
"SELECT ([Asset Number], Description, Serial_Number, Mfg, [Asset Type],
RDCnumber) FROM Assets"
--
Gran Andersson
_____
http://www.guffa.com
Date:Wed, 08 Aug 2007 21:05:58 +0200
Author:
|
Re: problem with .aspx.vb code
OK I double checked and corrected any incident of misspelling or
brackets missing and corrected those. But still the browser brings up
this: (And I know nothing about
reading a stack)
Also, do I have this syntaxed correctly (ignore the '& _'s as they are
just from reformat on paste)?:
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Server.MapPath(~/App_Data/Lowes.mdb));" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
___________________________________________________
Server Error in '/' Application.
---------------------------------------------------------------------------Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Multiple-step OLE
DB operation generated errors. Check each OLE DB status value, if
available. No work was done.
Source Error:
Line 33: da.SelectCommand = cmdSelect
Line 34: da.InsertCommand = cmdInsert
Line 35: da.Fill(ds, "
Date:Wed, 08 Aug 2007 12:49:21 -0700
Author:
|
Re: problem with .aspx.vb code
slinky wrote:
> OK I double checked and corrected any incident of misspelling or
> brackets missing and corrected those.
And now it looks like?
> But still the browser brings up
> this: (And I know nothing about
> reading a stack)
>
> Also, do I have this syntaxed correctly (ignore the '& _'s as they are
> just from reformat on paste)?:
>
> New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=Server.MapPath(~/App_Data/Lowes.mdb));" & _
> "Initial Catalog=Assets;Integrated Security=SSPI")
No. You have put Server.MapPath inside the string. There it doesn't mean
anything at all. Concatenate the return value from the method into the
string:
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Server.MapPath(~/App_Data/Lowes.mdb) & ";" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
--
Gran Andersson
_____
http://www.guffa.com
Date:Thu, 09 Aug 2007 00:42:47 +0200
Author:
|
Re: problem with .aspx.vb code
I tried this exact paste:
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Server.MapPath(~/App_Data/Lowes.mdb) & ";" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
And it didn't like the format so I redid it to:
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data &
_
Source=" & Server.MapPath(~/App_Data/Lowes.mdb) & ";" & _
"Initial Catalog=Assets;Integrated Security=SSPI")
And that didn't work either, so I tried just one long string:
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Server.MapPath(~/App_Data/Lowes.mdb) & ";" "Initial
Catalog=Assets;Integrated Security=SSPI")
or:
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Server.MapPath & _
(~/App_Data/Lowes.mdb) & ";" "Initial Catalog=Assets;Integrated
Security=SSPI")
Then it doesn't allow the "~" symbol. I see your point about putting
Server.MapPath outside the rest of the code, but I tried these
variations and couldn't get the syntax to be accepted.
Any ideas of what I'm doing wrong? And I really do appreciate your
help for this newbie!
On Aug 8, 6:42 pm, Göran Andersson wrote:
> No. You have put Server.MapPath inside the string. There it doesn't mean
> anything at all. Concatenate the return value from the method into the
> string:
>
> New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=" & Server.MapPath(~/App_Data/Lowes.mdb) & ";" & _
> "Initial Catalog=Assets;Integrated Security=SSPI")
>
> --
> Göran Andersson
> _____http://www.guffa.com
Date:Wed, 08 Aug 2007 19:47:53 -0700
Author:
|
Re: problem with .aspx.vb code
slinky wrote:
> I tried this exact paste:
>
> New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=" & Server.MapPath(~/App_Data/Lowes.mdb) & ";" & _
> "Initial Catalog=Assets;Integrated Security=SSPI")
That's only two lines, not three. I just edited the code that you posted.
I forgot the quotes around the string in the call to MapPath.
You really should read up a bit on the basic elements in the
programming, like strings and method calls. If you just copy and paste
code that you don't understand, you won't learn anything.
Code posted in newsgroups and articles often has small mistakes like
this, if you don't understand the code you can't fix those mistakes and
use the code.
--
Gran Andersson
_____
http://www.guffa.com
Date:Fri, 10 Aug 2007 22:52:13 +0200
Author:
|
Re: problem with .aspx.vb code
On Aug 10, 10:52 pm, Göran Andersson wrote:
> slinky wrote:
> > I tried this exact paste:
>
> > New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
> > Source=" & Server.MapPath(~/App_Data/Lowes.mdb) & ";" & _
> > "Initial Catalog=Assets;Integrated Security=SSPI")
>
> That's only two lines, not three. I just edited the code that you posted.
>
> I forgot the quotes around the string in the call to MapPath.
>
> You really should read up a bit on the basic elements in the
> programming, like strings and method calls. If you just copy and paste
> code that you don't understand, you won't learn anything.
>
> Code posted in newsgroups and articles often has small mistakes like
> this, if you don't understand the code you can't fix those mistakes and
> use the code.
>
> --
> Göran Andersson
> _____http://www.guffa.com
Agree with Göran.
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/04fa4e582f3bc1e6
Date:Fri, 10 Aug 2007 21:08:33 -0000
Author:
|
|
|