no more access

Get help on databases - MySQL, Oracle, Access, etc.
GreyWolf
Registered User
Posts: 4754
Joined: 06 Aug 2003, 02:00
Processor: PHENOM II 945
Motherboard: Asus M4A78
Graphics card: HIS ICEQ 4850 1GB
Memory: 4GB CORSAIR XMS II 1066
Location: , location, location!

Re: no more access

Post by GreyWolf »

rustypup wrote:yeah... delphi... now with added unicode - not that it took them all that long to achieve... you know... a few years or so, at the outside... :lol:

well he could always use assembler, since it is standardized and all.
"Every normal man must be tempted at times to spit on his hands, hoist that black flag, and begin slitting throats."
- H. L. Mancken
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

downloaded SharpDevelop......i got some learning to do.
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: no more access

Post by RuadRauFlessa »

Mclaren wrote:downloaded SharpDevelop......i got some learning to do.
Oh it's not that bad. And if you get stuck there are a bunch of us on the forum that knows C#
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

i don't even know yet how to get a button to show on the default form that will open a second form.
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: no more access

Post by RuadRauFlessa »

Mclaren wrote:i don't even know yet how to get a button to show on the default form that will open a second form.
Not a problem

Code: Select all

private void button1_Click(object sender, EventArgs e)
{
      Form2 frm = new Form2();
      frm.Show(this);
}
You actually have a couple of options. If you want to use the Form2 as a dialog then you can use

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FormTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 frm = new Form2();
            if (frm.ShowDialog(this) == DialogResult.Yes)
            {
                //do some processing if the user said yes
            }
        }
    }
}
and then you would have to change Form2 so that it sets the dialog result

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FormTest
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void btnYes_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Yes;
        }

        private void btnNo_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.No;
        }
    }
}
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: no more access

Post by RuadRauFlessa »

Oh and here is a very nice place to start reading :wink:
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

I am going to download Visual Studio Express along with several the other Express items avail through MS
Last edited by Mclaren on 12 Jul 2009, 20:11, edited 1 time in total.
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

almost 800MB, massive (for 3g that is), oh well.......
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: no more access

Post by RuadRauFlessa »

Mclaren wrote:almost 800MB, massive (for 3g that is), oh well.......
It is worth it though.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

Downloaded it, been playng on it for 2 days now. I have decided to use the vb express language as i am more familiar with vb for access.

I must say, i miss those button wizards etc.

So far i have learnt to add controls to forms, i have linked to an existing DB and can get a record onto a form, but further than that i am still learning.

i am trying to make 'navigation' buttons now on the form to go to the next record.

this is like starting to learn to walk again.
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: no more access

Post by RuadRauFlessa »

Any questions so far?
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

yeah, is there a way to set a forms record source to a table, as is done is Ms Access ? and

do you know of a good website for vb express 2008 ? and

is VB express vb.net ?
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: no more access

Post by RuadRauFlessa »

Mclaren wrote:yeah, is there a way to set a forms record source to a table, as is done is Ms Access ? and
Depends what controls you are using....
Mclaren wrote: do you know of a good website for vb express 2008 ? and
Google is your best friend here....
http://www.homeandlearn.co.uk/NET/vbNet.html
http://www.devarticles.com/c/b/VB.Net/
http://www.dotnetspider.com/tutorials/
http://www.computing.net/answers/dbase/ ... 8/579.html
http://www.daniweb.com/code/snippet696.html#
Mclaren wrote: is VB express vb.net ?
[/quote]
depends on how you created the project.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

yeah, google is a good friend of mine, its how i learnt access.

so i have a database which i linked to the project i am playing with. It is linked so the data does not form part of the new app, but rather stays an ms database. this until i learn a bit more about sql.

what my aim is is to try and create a navigation form that will allow me to scroll through the records in a table. this is the first thing i want to learn.

the next thing i want to learn is how to use a text box to enter in a value and then have the a button on the form return a message box stating if the record exists, if i can get these two functions/forms sorted by the weeeks end then i will be happy.

PS now of any good ebooks (free) that i can download ?
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: no more access

Post by RuadRauFlessa »

Ok so you have a form with a button and a bundle of controls. What you need to do is add an event to the button which retrieves the next record and displays it. Easy as that. Well not quite. You actually jumped into the deep end here. The problem with most of these applications is that you can't simply retrieve all of the records from the table or recordset and display them. Resultsets are forward seekable only so you can't go to the previous record. Well you can actually but it makes things a lot more troublesome. So I would presume that you have a decent key field on the table. Then simply keep a counter which points to the current record. On the event execute a query to return the next one and set the counter again. That way you can do the back/previous button too with little to no effort. This will have an impact on the db though as you will be performing more queries on it. Your other option would be to pre-load all of the records into memory. This is not advised as it could cause some serious memory usage. The other option is still to load them to memory but only to load a bundle like 20 or so at the max. You will need to do some nifty coding to manage this as you need to constantly update the buffer if you seek beyond a point to make sure the next data is available. Say you seek to nr 15 in the buffer you then need to go fetch the next 10 and trash everything below 10 so you always have 20 or so in memory to speed up the access. The management of this queue can even be done in the background in a buffer class you could create. I think though that the fetch on demand approach is the best for you. Depending on the controls you are using of course. Me, I don't like to use those high level controls as they tend to make the app slooooow and to increase the executable size dramatically.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

Ok, i have learnt a lot today, I have the following error on this line of code:

da.update(ds."employees")

the error is : OlseDb Exception, Syntax error in INSERT INTO statement.

my tabel is : tbl_Employees, with with the following fields : EmployeeID, FirstName, LastName

EmployeeID is a number format (Non AutoNumber) the others are text Format.

I got this code from : http://www.homeandlearn.co.uk/NET/nets12p10.html (i have only changed the "AddressBook" to "Employees"

Any ideas ? All the other code works perfectly.
Mclaren
Registered User
Posts: 497
Joined: 30 Apr 2007, 02:00
Location: c:\program files\temp
Contact:

Re: no more access

Post by Mclaren »

Also looking for code to maximise a window when in focus.
Post Reply