NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 39 40 41 42 43 … 93 Next »
Need help, using VB 2005 Express and Access

 
  • 0 Vote(s) - 0 Average
Need help, using VB 2005 Express and Access
TOM22
Offline

Junior Member

Posts: 3
Threads: 3
Joined: Sep 2007
#1
2007-09-21, 10:15 AM
Ok, bear with me, this must be obvious to someone but I can not get it.

I'm writing an application in Visual Basic 2005 Express, and in my project I have an Access database added (.mdb) and the dataset (.xsd). What I need to do is in some functions I'm writing, retrieve information from a Table in said database, and I'm sure there must be some easy built-in functions for doing this but I don't know them.

For example for a constructor:


Code:

Public Sub New(ByVal intID As Integer) intClassVariable = some data from the table retrieved using the ID parameter


The ID parameter being the ID on the Table of course.

So how do I accomplish this? I noticed I can declare objects as DataSets...do I need to set a 'DataSet' object to refer to the .xsd part of my project?

thanks in advance
_________________
raccoon control parental control software
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#2
2007-09-23, 06:29 AM
The closest thing I can think of for 'easy' and 'built in' would be the code snippets for database access, but I don't know if the Express edition has those or not.

Try right-clicking on the code window, and look for "Insert Snippet...". If it is there, select "Data - Designer Features and ADO.NET" followed by "Read Access Data into a Dataset".

It will give you a five line, "fill-in-the-blank" style of thing.

If the snippets thing isn't available, well, here are the five lines:

Code:
Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=AccessFile.mdb;Persist Security Info=False"
        Dim cmd As String = "Select * from Topics"
        Dim adapter As New OleDbDataAdapter(cmd, conn)
        Dim topics As New DataSet
        adapter.Fill(topics)

At a minimum you'll have to change the Source in the connection string, along with the cmd String.

The xsd file is not required, although the designer enjoys making them.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  NextPVR 5: When is PIN Required for API Access? pkscout 3 2,686 2020-05-26, 04:45 AM
Last Post: sub
  API access to artwork and deleting recordings cncb 29 15,542 2016-11-06, 02:20 AM
Last Post: mvallevand
  Version control / repository software for VS Express bgowland 2 2,388 2014-05-02, 09:57 PM
Last Post: bgowland
  Visual Studio C# 2008 Express needs registration bgowland 2 3,567 2011-11-22, 10:23 PM
Last Post: bgowland
  Access 'Stay on top' setting from a plugin? McBainUK 5 2,367 2011-11-07, 04:43 PM
Last Post: sub
  Access ImportHDPVRChannelsForm mvallevand 62 14,592 2011-08-09, 03:37 AM
Last Post: mvallevand
  Access to Schedules inside standalone progs dero 1 1,387 2008-12-09, 12:03 PM
Last Post: dero
  Linking gbpvr.db3 to Access 2003: get readonly tables Khurram 5 3,919 2008-09-11, 08:35 AM
Last Post: Khurram
  Access to FSE switch idkpmiller 12 4,209 2008-07-05, 04:01 PM
Last Post: whurlston
  Access DB and DateTime idkpmiller 5 2,330 2008-04-14, 10:37 AM
Last Post: idkpmiller

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode