vb.net - How to dynamically create access database with date field having custom date format? -
can please me on current problem?
i doing project dynamically creates access database (.mdb file). database have date field want have custom date format.
here have far.
dim con new oledb.oledbconnection("provider=microsoft.jet.oledb.4.0;data source =" & databasename) con.open() dim dbschema datatable = con.getoledbschematable(oledb.oledbschemaguid.tables, _ new object() {nothing, nothing, tablename, "table"}) con.close() if dbschema.rows.count > 0 'i have code here else 'this create table dim cmd new oledb.oledbcommand("create table [" + tablename + "] ([meter] text(2), [name] text(20), " _ & "[element1] text(20), [element2] text(20), [element3] text(20), [w] text(20), " _ & "[pf] text(20), [kwh_delivered] text(20), [kwh_received] text(20), " _ & "[date_time] date(mm/dd/yyyy hh:nn:ss))", con) cmd.executenonquery() con.close() messagebox.show("table created successfully") end if thanks!
i have work around problem.i did not solve problem instead work around code needs value , there replaced format. anyway.
Comments
Post a Comment