Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

simple question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Web Search Store - 07 Feb 2008 22:46 GMT
Hello,

I'm finally trying to use asp.net

I would appreciate any code sample on how to translate the following code
that opens an access database:

dim mydsn
dim conntemp
dim sqlstmt
mydsn="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\myaccessdb.mdb"
set conntemp=server.createobject("adodb.connection")
conntemp.open mydsn
sqlstmt = "Select  * from item_table order by item_matching_score DESC"
Set RS = conntemp.Execute(sqlstmt)
if not RS.bof and not RS.eof then
 response.write "<br>record number=" &  cstr(RS("item_number"))
 end if

Or tell me the best place to look for this.

Thank you very much.

Scott
Scott M. - 08 Feb 2008 00:59 GMT
Using con As New
OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=c:\myaccessdb.mdb")
  Dim cmd As New OleDb.OleDBCommand("Select  * from item_table order by
item_matching_score DESC", con)

  Try
       con.Open
       Dim dr As OleDb.OleDbDataReader =
cmd.ExecuteReader(CommandBehavior.CloseConnection)
       Dim i As Integer = 1
       Do While dr.Read()
              Response.Write("<br>record number=" &  i)
              i +=1
       Loop
  Catch ex As OleDbException
       'Handle exceptions from the database here

  Catch ex As Exception
       'Handle exceptions from .NET here

  Finally
       dr.Close()
       dr.Dispose()
       cmd.Dispose()
  End Try

End Using

> Hello,
>
[quoted text clipped - 20 lines]
>
> Scott
Web Search Store - 08 Feb 2008 01:32 GMT
Thank you very much!

I'll give it a try.

Scott
> Using con As New
> OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
[quoted text clipped - 49 lines]
>>
>> Scott
Web Search Store - 08 Feb 2008 18:20 GMT
When I used the code pasted here, I got the error pasted below it:

Any help appreciated.

Scott
<html>

<%

Using con As New
system.data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE='e:\websearchstore_server\data\database_directory.mdb'")
  Dim cmd As New system.data.OleDb.OleDBCommand("Select  * from
www_item_table ", con)
    con.Open
Dim dr As system.data.OleDb.OleDbDataReader =
cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)

  Try

        Dim i As Integer = 1
       Do While dr.Read()
              Response.Write("<br>record number=" &  i)
              i +=1
       Loop
  Catch ex As system.data.oledb.OleDbException
       'Handle exceptions from the database here

  Catch ex As Exception
       'Handle exceptions from .NET here

  Finally
       dr.Close()
       dr.Dispose()
       cmd.Dispose()
  End Try

End Using

%>
</html>

Could not find installable ISAM.
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: Could not find
installable ISAM.

Source Error:

Line 7:  Using con As New
system.data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE='e:\websearchstore_server\data\database_directory.mdb'")
Line 8:     Dim cmd As New system.data.OleDb.OleDBCommand("Select  * from
www_item_table ", con)
Line 9:       con.Open
Line 10:  Dim dr As system.data.OleDb.OleDbDataReader =
cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
Line 11:

> Thank you very much!
>
[quoted text clipped - 54 lines]
>>>
>>> Scott
Scott M. - 08 Feb 2008 22:16 GMT
That usually means that you haven't specified the correction database
provider or don't have the correct provider.

The connection string I provided is correct.

> When I used the code pasted here, I got the error pasted below it:
>
[quoted text clipped - 116 lines]
>>>>
>>>> Scott

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.