Results 1 to 3 of 3

Thread: runtime error '-2147217900(80040e14)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2019

    runtime error '-2147217900(80040e14)

    rundate = convert(datetime, convert(varchar(10),dateadd(wk, datediff(wk, 0,getdate())), 103),103)

    What will be the output for above, Is the syntax correct.

    Expected output : data need to be fetched from database

    Output on daily basis with weekly calculated of sum from table.

    Private Sub Command1_Click()

    If Len(Text1.Text) > 140 Then
    MsgBox " Maximum allowed length is only 140 Chrs.", vbCritical
    Exit Sub
    End If

    Dim inval, instring As String
    Dim i, j, k As Integer
    Dim del As Double
    Dim cn As ADODB.Connection
    Dim strcn As String
    Dim excstr As String
    Dim ctr As Integer

    Set cn = New ADODB.Connection
    strcn = Adodc2.ConnectionString
    cn.Open strcn

    Adodc2.RecordSource = "select Mobile from tbl_smsdir where progname = 'Daily'"


    If Adodc2.Recordset.RecordCount > 0 Then

    For i = 1 To Adodc2.Recordset.RecordCount
    List2.AddItem (Adodc2.Recordset("mobile"))
    Next i
    MsgBox "No Records"
    End If

    Adodc2.RecordSource = "Select 'Status - '+'Daily Plan - '+convert(varchar(6),dayplan)+' : '+'Plan Vs Act - '+convert(varchar(6),tillplan)+' Vs '+ " & _
    " convert(varchar(6),dayact)+' : Yesterday - '+ convert(varchar(6),dayact) from salesstatus " & _
    " where rundate = convert(datetime, convert(varchar(10),dateadd(wk, datediff(wk, 0,getdate())), 103),103)"

    Text1.Text = Adodc2.Recordset(0)

    del = Val(Text2.Text)

    If MSComm1.PortOpen = True Then
    MSComm1.PortOpen = False

    Call Command2_Click

    End Sub

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Beside Waldo

    Re: runtime error '-2147217900(80040e14)

    Welcome to the forums

    Your question regarding the Convert() statement you pasted can be easily determined by looking at SQL help files or on line, for example: https://www.w3schools.com/sql/sql_ref_sqlserver.asp

    Question: what type of database you are connecting to?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online

    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2019

    Re: runtime error '-2147217900(80040e14)

    Ms sql

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width