Hi Ian,
Thanks for getting back to me.
Do you know how you would be able to use this new prompt box but to sandwich this into my current code? So that the box appears, we then input the ID and password and then that is put into the line of code where we are then connecting to the database?
I have tried to use "teb1" and "user" both with and without quotations. Surely I must be a missing a little something which means that it isn't working?
I see that the prompt works for the passowrd however I cannot work out how to get this to then put the password into the database query.
NamesDefaultToHere(1);
nw = NewWindow("Cooext To Database",
PanelBox("Input your credentials",
LineUpBox(NCol(2),
TextBox("User:"),
teb1 = TextEditBox("", << setWidth(200)),
TextBox("Password:"),
teb2 = TextEditBox("", << setWidth(200), << passwordStyle(1))
);
),
LineUpBox(NCol(2),
ButtonBox("OK", OKscript),
ButtonBox("Cancel", nw << closeWindow)
);
);
OKScript =
Expr(
nw << closeWindow;
user = teb1 << getText;
pass = teb2 << getText;
// DB connection info . . .
Speak("User was "||user, wait(1));
Speak("Password was "||pass, wait(1));
);
Dt1=Open Database(
"DSN=MACPAC;SYSTEM=MEDIUK;UID=(HOW TO GET UID HERE?);PASSWORD=(HOW TO GET PASSWORD HERE?;DBQ=MPDAT10;DFTPKGLIB=QGPL;LANGUAGEID=ENU;PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;QRYSTGLMT=-1;",
"Select ixplot as batchid,
ixppn as product_part_no,
ixrecq as batch_size,
ixlevl as macpac_level,
ixcpn as comp_part_no,
ixcpde as comp_desc,
ixclot as comp_lot_no,
ixcmpo as comp_order_no,
ixissq as comp_qty,
ixvend as vendor_code,
ixvlot as vendor_lot_no,
ixseqn as sequence
FROM \!"MPDAT10\!".\!"ICM860P\!""
);
Thanks,
Jacob