Page 2 of 2

Re: no more access

Posted: 06 Jul 2009, 16:36
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.

Re: no more access

Posted: 07 Jul 2009, 14:26
by Mclaren
downloaded SharpDevelop......i got some learning to do.

Re: no more access

Posted: 07 Jul 2009, 14:56
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#

Re: no more access

Posted: 08 Jul 2009, 11:20
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.

Re: no more access

Posted: 08 Jul 2009, 11:37
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;
        }
    }
}

Re: no more access

Posted: 08 Jul 2009, 11:46
by RuadRauFlessa
Oh and here is a very nice place to start reading :wink:

Re: no more access

Posted: 12 Jul 2009, 20:02
by Mclaren
I am going to download Visual Studio Express along with several the other Express items avail through MS

Re: no more access

Posted: 12 Jul 2009, 20:06
by Mclaren
almost 800MB, massive (for 3g that is), oh well.......

Re: no more access

Posted: 13 Jul 2009, 00:16
by RuadRauFlessa
Mclaren wrote:almost 800MB, massive (for 3g that is), oh well.......
It is worth it though.

Re: no more access

Posted: 15 Jul 2009, 16:12
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.

Re: no more access

Posted: 15 Jul 2009, 16:50
by RuadRauFlessa
Any questions so far?

Re: no more access

Posted: 16 Jul 2009, 08:19
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 ?

Re: no more access

Posted: 16 Jul 2009, 10:52
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.

Re: no more access

Posted: 16 Jul 2009, 16:18
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 ?

Re: no more access

Posted: 17 Jul 2009, 10:00
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.

Re: no more access

Posted: 17 Jul 2009, 14:22
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.

Re: no more access

Posted: 17 Jul 2009, 14:23
by Mclaren
Also looking for code to maximise a window when in focus.