Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
acko
Yak Posting Veteran
52 Posts |
Posted - 2003-08-19 : 11:29:39
|
I cannot insert datetime value in sqlserver table from vbI use datapicker controlHere is code Dim cn As ADODB.Connection Set cn = New ADODB.Connection cn.Provider = "SqlOledb" cn.Properties("User ID") = "sa" cn.Properties("Password") = "password" cn.Properties("Initial Catalog") = "NorthWind" cn.Properties("Data Source") = "AckoB" cn.OpenI tryed the following and nothing is working cn.Execute "Insert datum values Datum (#" & dt.Value & "#)" cn.Execute "Insert datum values Datum (" & dt.Value & ")" cn.Execute "Insert datum values Datum (" & dt.Value & ")"thanksAlex |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-08-19 : 11:37:06
|
trycn.Execute "Insert datum values ('" & format(dt.Value,"YYYYMMDD") & "')"==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
acko
Yak Posting Veteran
52 Posts |
Posted - 2003-08-19 : 11:47:24
|
Thanks very muchAlexandar |
 |
|
|
|
|