Database menggunakan SQL Server dengan Nama Tabel : Trans1 dengan Nama Field
tambahan : jam_trs dan ketika nambah Field aku Insert bukan tambah dibawahnya.
Pada VB aku pakai Text dengan nama jam_trs
Kenapa keluar Application Usees A value of the Wrong type for the Current
Operation.
Aku mengunakan Store Procedure pada Querynya.
Contoh Prog Simpannya.
rivate Sub Simpan()
On Error GoTo iniEror
Dim oCO As ADODB.Command
Set oCO = New ADODB.Command
Set oCO.ActiveConnection = oConn
oCO.CommandText = "pr_tambah_Trans1"
oCO.CommandType = adCmdStoredProc
oCO.Parameters("@no").Value = Text1.Text
oCO.Parameters("@tgl").Value = dtp1.Value
oCO.Parameters("@user").Value = gUser
oCO.Parameters("@Dept").Value = gDepUser
oCO.Parameters("@keterangan").Value = Text4.Text
oCO.Parameters("@lokasi").Value = Text5.Text
oCO.Parameters("@Updates").Value = ""
oCO.Parameters("@jam_trs").Value = jam.Text
If OPTJK(0).Value = True Then
oCO.Parameters("@statuss").Value = "Urgent"
Else
oCO.Parameters("@statuss").Value = "Regular"
End If
oCO.Execute
MsgBox "DATA HAS BEEN SAVED !", vbInformation, "ATTENTION......."
Text1.Text = ""
Text4.Text = ""
Text5.Text = ""
dtp1.Value = Date
jam.Text = Time
Label9.Caption = ""
Text1.SetFocus
'Call SemuaTrans1
Exit Sub
iniEror:
MsgBox Err.Description, vbCritical
End Sub
Contoh Program Update
Private Sub UpdateTrans1()
On Error GoTo iniEror
Dim oCO As ADODB.Command
Set oCO = New ADODB.Command
Set oCO.ActiveConnection = oConn
oCO.CommandText = "Update_Trans1"
oCO.CommandType = adCmdStoredProc
oCO.Parameters("@no").Value = Text1.Text
oCO.Parameters("@tgl").Value = dtp1.Value
oCO.Parameters("@user").Value = gUser
oCO.Parameters("@Dept").Value = gDepUser
oCO.Parameters("@keterangan").Value = Text4.Text
oCO.Parameters("@lokasi").Value = Text5.Text
oCO.Parameters("@Updates").Value = " "
oCO.Parameters("@jam_trs").Value = jam.Text
If OPTJK(0).Value = True Then
oCO.Parameters("@statuss").Value = "Urgent"
Else
oCO.Parameters("@statuss").Value = "Regular"
End If
oCO.Execute
MsgBox "DATA HAS BEEN UPDATED !", vbInformation, "ATTENTION......."
Text1.Text = ""
Text4.Text = ""
Label9.Caption = ""
dtp1.Value = Date
jam.Text = Time
Text1.SetFocus
'Call SemuaTrans1
Exit Sub
iniEror:
MsgBox Err.Description, vbCritical
End Sub
Ade Aan Wirama <[EMAIL PROTECTED]> wrote:
type @jam apa? datetime? atau text?
kalo datetime, coba ganti jam.text dengan datepicker
tapi formatnya jam, atau convert dulu jam.text ke
datetime format.
semoga membantu...
tks & rgds,
Ade Aan Wirama
J-DEVELOPMENT (as partner of Yayasan Jaring
Kemanusiaan Nusantara)
Coding for Humanity
wirama.wordpress.com
--- Kadek Pong <[EMAIL PROTECTED]> wrote:
> Pada mulanya program jalan, ketika pada tabel saya
> tambahkan Field Jam_trs dan
> Ketika mau menyimpan dan di Tris pada @jam keluar
> pesan Application uses...
> Jadi coding seperi ini :
> Private Sub Simpan()
> On Error GoTo iniEror
> Dim oCO As ADODB.Command
> Set oCO = New ADODB.Command
> Set oCO.ActiveConnection = oConn
> oCO.CommandText = "pr_tambah_Trans1"
> oCO.CommandType = adCmdStoredProc
> oCO.Parameters("@no").Value = Text1.Text
> oCO.Parameters("@tgl").Value = dtp1.Value
> oCO.Parameters("@user").Value = gUser
> oCO.Parameters("@Dept").Value = gDepUser
> oCO.Parameters("@keterangan").Value = Text4.Text
> oCO.Parameters("@lokasi").Value = Text5.Text
> oCO.Parameters("@jam").Value = jam.Text
> oCO.Parameters("@Updates").Value = ""
> If OPTJK(0).Value = True Then
> oCO.Parameters("@statuss").Value = "Urgent"
> Else
> oCO.Parameters("@statuss").Value = "Regular"
> End If
>
> oCO.Execute
> MsgBox "DATA HAS BEEN SAVED !", vbInformation,
> "ATTENTION......."
> Text1.Text = ""
> Text4.Text = ""
> Text5.Text = ""
> dtp1.Value = Date
> jam.Text = Time
> Label9.Caption = ""
> Text1.SetFocus
> 'Call SemuaTrans1
> Exit Sub
> iniEror:
> MsgBox Err.Description, vbCritical
> End Sub
>
> Tolong bantu Yaa......
>
> Ade Aan Wirama <[EMAIL PROTECTED]> wrote:
> Ini kadek pong di tambun? namanya kayak
> nama sepupu
> saya..hehehehe
>
> mungkin pesan errornya Application uses ... bukan
> Application user ya...
>
> sepertinya masalah dengan query yang berhubungan
> dengan field tanggal, tapi agak susah nih kalo nggak
> ada detailnya, apa yang diquery, fieldnya, dan
> databasenya pake sql server atau acess, dll
>
> bisa lebih lengkap lagi?
>
> Tks & Rgds,
> Ade Aan Wirama
> J-DEVELOPMENT (as partner of Yayasan Jaring
> Kemanusiaan Nusantara)
> Coding for Humanity
> wirama.wordpress.com
>
> --- Kadek Pong <[EMAIL PROTECTED]> wrote:
>
> > Teman2, minta tolong,
> >
> > saya baru belajar bikin program, ketika Input
> > transaksi keluar pesan "
> >
> > Application User a Value for the Wrong Type for
> > the current Operation.
> >
> > Apa artinya pesan ini.
> >
> > Thx
> > Kadek
> >
> >
> > ---------------------------------
> > Want to be your own boss? Learn how on Yahoo!
> Small
> > Business.
> >
> > [Non-text portions of this message have been
> > removed]
> >
> >
> >
> > Untuk berhenti berlangganan kirim email kosong ke
> :
> > [EMAIL PROTECTED]
> >
> > Forum ini berkembang dengan pesat, jika anda
> > memiliki
> > dedikasi dan waktu, silahkan mengaplikasikan diri
> > menjadi moderator.
> > Yahoo! Groups Links
> >
> >
> > [EMAIL PROTECTED]
> >
> >
> >
> >
> >
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
>
>
>
> ---------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls
> to the US (and 30+ countries) for 2ยข/min or less.
>
> [Non-text portions of this message have been
> removed]
>
>
>
> Untuk berhenti berlangganan kirim email kosong ke :
> [EMAIL PROTECTED]
>
> Forum ini berkembang dengan pesat, jika anda
> memiliki
> dedikasi dan waktu, silahkan mengaplikasikan diri
> menjadi moderator.
> Yahoo! Groups Links
>
>
> [EMAIL PROTECTED]
>
>
>
>
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------
Want to be your own boss? Learn how on Yahoo! Small Business.
[Non-text portions of this message have been removed]
Untuk berhenti berlangganan kirim email kosong ke : [EMAIL PROTECTED]
Bagi terjangkit virus lokal, zip virus tersebut
dan kirim ke [EMAIL PROTECTED], kami
akan membuat removalnya untuk anda.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/indoprog-vb/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/