Home > database > The window of the pb extracted excel as a data source data
The window of the pb extracted excel as a data source data
Time:09-16
Pb window can't extract excel as a data source of data, I use the ODBC connection, to excel as a data source, data sheet for table window using the preview on the menu button to display the data, but in pb open control using dw_1. Retreve () to extract data, the Database transaction information not available. Call SetTrans or SetTransObject function, the dw_1. SetTransObject (sqlca), but useless, should be no connection to excel, please expert advice on how to write code to implement
CodePudding user response:
Above supplement: my email is: [email protected], QQ914955679 hope ace directions
CodePudding user response:
Connect using the sqlca; Wrote this sentence
CodePudding user response:
String ls_sql ls_syntax, ls_error, ls_pathname='c: \ temp. XLSX', filepath, filename, ls_gb, ls_order Long I, ll_row String ls_where []
If the sqlca. Sqlcode & lt;> 0 then Messagebox (' prompt ', 'read the file failed, please check the sheet name or the program is running environment! ') End the if
Disconnect the using ls_tran;
Destroy ls_tran
CodePudding user response:
The third floor of a see saved a lot of steps, are interested in?
CodePudding user response:
I have also seen your reply posts, probably similar to this, I tried the things too much, you save a lot of places I haven't read, of course I am a novice, just learn to write, but this kind of thinking method can write or draw lessons from, take the GetCurrentDirectory (), the function, for instance, is to direct assignment path or write a global function to the other path I tried all error, GetFileOpenName (" Select File ", FilePath, FileName, "*. *", "EXCEL File (*. XLS; *. XLSX), *. XLS; *. XLSX, "GetCurrentDirectory (), 18) this sentence is to can not find the GetCurrentDirectory () And this is it affirms beforehand, just right here, this is I can't,,,,,,,,