Board index » Visual Studio » vb6 newbie needs help!

vb6 newbie needs help!

Visual Studio20
1. a

.Alex, when I copy my project folder with my access database file in it and

move copy to another directory, the program is still bound to databsebase

file in the original directory. can I put the app.path in the datacontrols

database property instead of the absolute path. I tried but does not work I

tried in design mode app.path & "\actionamusement.mdb" but does not work,

is this a syntax error.



1.b.

when I connect to databse at run time using code below, the controls I bind

also at run time do not save to bound fileds in database. here is the code,

can you see the problem.



Form_Load()

with dataControl1

.databasename = app.path & "\ActionAmusements.mdb"

.recordsource = "tblSales"

End with



txtMachine1Gross.datafield = "Machine1Gross" (field I vreated in

database)



I also tried inserting this statement just above the control binding

statment above:



txtMachine1Gross.datasource = "dataControl1"

txtMachine1Gross.datafield = "Machine1Gross" (field I vreated in database)



1.c.

Is one of my problems that I cannot use a datacontrol object and use

database statements in code. Can I mix and match.



1.d.

Shoud I and can I connect to the database without using the vbdatacontrol

and just maybe SQL code?


-
 

Re:vb6 newbie needs help!



"adamspencer2004" <adamspencer2004@discussions.microsoft.com>wrote in

message news:1397EEB9-2C1C-445E-9F03-90823BFDDE46@microsoft.com...

Quote
1. a

.Alex, when I copy my project folder with my access database file in it

and

move copy to another directory, the program is still bound to databsebase

file in the original directory. can I put the app.path in the datacontrols

database property instead of the absolute path. I tried but does not work

I

tried in design mode app.path & "\actionamusement.mdb" but does not

work,

is this a syntax error.



1.b.

when I connect to databse at run time using code below, the controls I

bind

also at run time do not save to bound fileds in database. here is the

code,

can you see the problem.



Form_Load()

with dataControl1

.databasename = app.path & "\ActionAmusements.mdb"

.recordsource = "tblSales"

End with



txtMachine1Gross.datafield = "Machine1Gross" (field I vreated in

database)



I also tried inserting this statement just above the control binding

statment above:



txtMachine1Gross.datasource = "dataControl1"

txtMachine1Gross.datafield = "Machine1Gross" (field I vreated in

database)



1.c.

Is one of my problems that I cannot use a datacontrol object and use

database statements in code. Can I mix and match.



1.d.

Shoud I and can I connect to the database without using the vbdatacontrol

and just maybe SQL code?



put the mdb file in the same directory as the app and use 'mapPath'







---

Outgoing mail is certified Virus Free.

Checked by AVG anti-virus system (www.grisoft.com).">www.grisoft.com).

Version: 6.0.799 / Virus Database: 543 - Release Date: 11/19/2004





-