Posts: 488
Name: Chip Johns
Location: Savannah Georgia
|
I am trying to take the asp.net plunge. Not as easy as asp...!
A couple of questions... If I may?
Something I do not understand. Declaring the database does so through showing where the actual database resides. I am used to using the DSN. What is the difference?
Do I still need to set the database with a ODBC Connection on the server?
I also read on one of the tutorials about setting up a Virtual Server. I tried this and still found no success...
I'm just not understanding the logic as easily as I did with asp(NOT NET)
Here is the connnection string I am trying, What AM I missing?
Code:
<script language="VB" runat="server">
sub Page_Load
dim dbconn, sql, dbcomm, dbread, tbl_VIP_Surv
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("marketing1.mdb"))
dbconn.Open()
sql="SELECT * FROM tbl_VIP_Surv"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
tbl_VIP_Surv.DataSource=dbread
tbl_VIP_Surv.DataBind()
dbread.Close()
dbconn.Close()
end sub
</script>
Here is the error:
Object variable or With block variable not set.
Code:
Line 24: dbcomm=New OleDbCommand(sql,dbconn)
Line 25: dbread=dbcomm.ExecuteReader()
Line 26: tbl_VIP_Surv.DataSource=dbread
Line 27: tbl_VIP_Surv.DataBind()
Line 28: dbread.Close()
Thanks for any help..
Chip
Last edited by ChipJohns; 04-07-2008 at 05:06 PM..
|