Hi, I want to write a contacts manager program.

djy_testimony
Mon Mar 2 09:10:14 PST 2009


I'm stuck, I'm coming slowly with BCX, I'm used to LB & JB.

Here's my code. I'm trying to learn from the Create_Database.Bas file
by Mr. Kevin.

By the way, is that file copyrighted, or can I build on it? Who owns
the license?

gui " "

global w as hwnd
global p as control
global i1 as control
global i2 as control
global i3 as control
global i4 as control
global i5 as control
global i6 as control
global i7 as control
global i8 as control
global i9 as control
global i10 as control
global n as control
global up as control
global down as control
global c as control
global nuw as control
CONST Contacts$ = "C:\contacts.mdb"


sub formload()
    w = bcx_form("", 0, 0, 362, 184)
    p = bcx_olepicture("", w, 0, 0, 0, 0, 0, 123)
    i1 = bcx_input("", w, 999, 4, 13, 170, 10)
    i2 = bcx_input("", w, 998, 4, 40, 170, 10)
    i3 = bcx_input("", w, 997, 4, 50, 170, 10)
    i4 = bcx_input("", w, 996, 4, 60, 170, 10)
    i5 = bcx_input("", w, 995, 4, 70, 170, 10)
    i6 = bcx_input("", w, 994, 4, 80, 170, 10)
    i7 = bcx_input("", w, 993, 177, 13, 170, 10)
    i8 = bcx_input("", w, 992, 177, 40, 170, 10)
    i9 = bcx_input("", w, 991, 177, 67, 170, 10)
    i10 = bcx_input("", w, 990, 177, 94, 170, 10)
    n = bcx_edit("", w, 989, 4, 121, 170, 50)
    up = bcx_button("up", w, 988, 177, 120, 15, 15)
    down = bcx_button("down", w, 987, 177, 150, 25, 15)
    c = bcx_combobox("", w, 986, 195, 120, 164, 60)
    nuw = bcx_button("new", w, 985, 210, 150, 20, 15)
show(w)
end sub

begin events


IF EXIST (Contacts$) THEN

ELSE

makeDB (Contacts$)

END IF

Folder$ = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Contacts$

SET roboticArm = CreateObject("ADODB.Connection")

roboticArm.Open Folder$

SQL$ = "CREATE TABLE Contacts (Contact Name text(50), Address 1
text(50), Address 2 text(50), Address 3 text(50), Address 4 text(50),
Address 5 text(50), Notes text(500), Position text(50), Website
text(50), Email text(50))"

roboticArm.Execute SQL$
end events


SUB makeDB (thedb$)
LOCAL database$
robot AS OBJECT
SET robot = CreateObject("ADOX.Catalog")
database$ = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + thedb$
robot.Create database$
SET robot = Nothing
END SUB




           



More information about the BCX mailing list