txtfield().datasource property, without Adodc control

txtfield().datasource property, without Adodc control

Post by GV » Tue, 23 Jan 2001 23:37:58



Hello,

        New to this, How do I set the txtfield().datasource property to my
recordset.  I'm trying to not use a Adodc control.
     I'm trying to create a form to insert records. Is there a better
way\faster way? Without using Adodc control.
       Stored Procedure better? If so get me started please.  I have
attempted to start it below.

Thanks
GV

Private Sub Form_Load()

    connadd.ConnectionString = "Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial
    Catalog=EUS;Data Source=18.23.16.8"
    connadd.CursorLocation = adUseClient    connadd.Open
    Set rsadd.ActiveConnection = connadd
    rsadd.CursorType = adOpenStatic
    rsadd.LockType = adLockOptimistic
    rsadd.Source = "patientclinical"       <<--------------   table name
    rsadd.Open

    txtfield(0).DataField = "Hosp_no"
    txtfield(1).DataField = "dateofex"
    txtfield(2).DataField = "firstname"
    txtfield(3).DataField = "middle"
    txtfield(4).DataField = "lastname"
    DataCombo1.DataField = "endoscope1"
    DataCombo5.DataField = "endoscope2"
    DataCombo2.DataField = "referal"
    DataCombo3.DataField = "instrument"

 
 
 

txtfield().datasource property, without Adodc control

Post by Ralf Ksciu » Wed, 24 Jan 2001 01:26:13


Hi GV,

you also have to assign the datasource properties for the bound controls,
e.g.:

 txtfield(0).DataField = "Hosp_no"
Set  txtfield(0).DataSource = rsadd
txtfield(1).DataField = "dateofex"
Set txtfield(1).DataSource = rsadd

and so on ...

You can find another example in:

PRB: Data Bindings Lost When ADO Recordset Is Closed
http://support.microsoft.com/support/kb/articles/q192/3/83.asp

Hope this helps
Ralf



Quote:> Hello,

>         New to this, How do I set the txtfield().datasource property to my
> recordset.  I'm trying to not use a Adodc control.
>      I'm trying to create a form to insert records. Is there a better
> way\faster way? Without using Adodc control.
>        Stored Procedure better? If so get me started please.  I have
> attempted to start it below.

> Thanks
> GV

> Private Sub Form_Load()

>     connadd.ConnectionString = "Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial
>     Catalog=EUS;Data Source=18.23.16.8"
>     connadd.CursorLocation = adUseClient    connadd.Open
>     Set rsadd.ActiveConnection = connadd
>     rsadd.CursorType = adOpenStatic
>     rsadd.LockType = adLockOptimistic
>     rsadd.Source = "patientclinical"       <<--------------   table name
>     rsadd.Open

>     txtfield(0).DataField = "Hosp_no"
>     txtfield(1).DataField = "dateofex"
>     txtfield(2).DataField = "firstname"
>     txtfield(3).DataField = "middle"
>     txtfield(4).DataField = "lastname"
>     DataCombo1.DataField = "endoscope1"
>     DataCombo5.DataField = "endoscope2"
>     DataCombo2.DataField = "referal"
>     DataCombo3.DataField = "instrument"


 
 
 

txtfield().datasource property, without Adodc control

Post by GV » Wed, 24 Jan 2001 05:29:17


Thanks you
gv


> Hi GV,

> you also have to assign the datasource properties for the bound controls,
> e.g.:

>  txtfield(0).DataField = "Hosp_no"
> Set  txtfield(0).DataSource = rsadd
> txtfield(1).DataField = "dateofex"
> Set txtfield(1).DataSource = rsadd

> and so on ...

> You can find another example in:

> PRB: Data Bindings Lost When ADO Recordset Is Closed
> http://support.microsoft.com/support/kb/articles/q192/3/83.asp

> Hope this helps
> Ralf



> > Hello,

> >         New to this, How do I set the txtfield().datasource property to
my
> > recordset.  I'm trying to not use a Adodc control.
> >      I'm trying to create a form to insert records. Is there a better
> > way\faster way? Without using Adodc control.
> >        Stored Procedure better? If so get me started please.  I have
> > attempted to start it below.

> > Thanks
> > GV

> > Private Sub Form_Load()

> >     connadd.ConnectionString = "Provider=SQLOLEDB.1;Persist Security
> > Info=False;User ID=sa;Initial
> >     Catalog=EUS;Data Source=18.23.16.8"
> >     connadd.CursorLocation = adUseClient    connadd.Open
> >     Set rsadd.ActiveConnection = connadd
> >     rsadd.CursorType = adOpenStatic
> >     rsadd.LockType = adLockOptimistic
> >     rsadd.Source = "patientclinical"       <<--------------   table name
> >     rsadd.Open

> >     txtfield(0).DataField = "Hosp_no"
> >     txtfield(1).DataField = "dateofex"
> >     txtfield(2).DataField = "firstname"
> >     txtfield(3).DataField = "middle"
> >     txtfield(4).DataField = "lastname"
> >     DataCombo1.DataField = "endoscope1"
> >     DataCombo5.DataField = "endoscope2"
> >     DataCombo2.DataField = "referal"
> >     DataCombo3.DataField = "instrument"