Solomon v6.5
I have created a custom table using an identity field using the VB Tools
Record maintenance, Field Maintenance, and Generate Schema. In VB tools I am
trying to insert a record into the custom table. I am not moving any value
to the identity field.
The program is putting this error message in the
eventlog:
System Message 6124: Process started: Wed May 13 08:46 A.M.
================================================================================
Processing: Preparing working files
System Message 102: Incorrect syntax near ')'.
Debugging info:
dbsqlexec,sInsertFastIO - ExecuteDbProc
Cursor(csr_xEmailInvStmt) Select * from xEmailInvStmt
Optional info:
(adminno,belowamtmin,billattn,custid,custstatf
System Message 6127: Error occurred during an abortable transaction.
Processing
will continue.
================================================================================
System Message 6125: Process ended: Wed May 13 08:47 A.M.
If I remove the identy field the insert works fine. What am I doing
incorrectly.
Here is some additional information that might help.
DROP TABLE xEmailInvStmt
Go
Print 'Creating table: xEmailInvStmt'
Go
Create Table xEmailInvStmt (
AdminNo char (10),
BelowAmtMin smallint,
BillAttn char (30),
CustID char (15),
CustStatFlag smallint,
DateSent smalldatetime,
DocType smallint,
EmailAddr char (60),
FileName char (30),
Name char (30),
Status smallint,
User1 char (30),
User2 char (30),
User3 float,
User4 float,
User5 char (10),
User6 char (10),
User7 smalldatetime,
User8 smalldatetime,
VerID int identity(1,1)
,tstamp Timestamp)
Go
CREATE unique CLUSTERED
INDEX [xEmailInvStmt0] ON [dbo].[xEmailInvStmt] ([VerID])
WITH
DROP_EXISTING
ON [PRIMARY]
GO
CREATE
INDEX [xEmailInvStmt1] ON [dbo].[xEmailInvStmt] ([CustID])
WITH
DROP_EXISTING
ON [PRIMARY]
GO
Option Explicit
Attribute VB_Name = "ModulexEmailInvStmtDH"
Type xEmailInvStmt
AdminNo As String * 10
BelowAmtMin As Integer
BillAttn As String * 30
CustID As String * 15
CustStatFlag As Integer
DateSent As Sdate
DocType As Integer
EmailAddr As String * 60
FileName As String * 30
Name As String * 30
Status As Integer
User1 As String * 30
User2 As String * 30
User3 As Double
User4 As Double
User5 As String * 10
User6 As String * 10
User7 As Sdate
User8 As Sdate
VerID As Long
End Type
Global bxEmailInvStmt As xEmailInvStmt, nxEmailInvStmt As xEmailInvStmt
Attribute VB_Name = "xEmailInvStmt_Dhb"
'''''''''''''''''''''''''''''''''''
'jlg - 05-08-2009
' Checked for v6.5
'''''''''''''''''''''''''''''''''''
Option Explicit
Global csr_xEmailInvStmt As Integer
Global err_xEmailInvStmt As Integer
Global mem_xEmailInvStmt As Integer
Global grid_xEmailInvStmt As Integer
Function dbnavfetch_xEmailInvStmt(ctrl As Control, chkstrg As String,
notfoundok As Integer) As Integer
Dim retval As Integer
retval = DBNavFetch1(ctrl, csr_xEmailInvStmt, chkstrg,
bxEmailInvStmt, LenB(bxEmailInvStmt))
If notfoundok Then
If retval = NOTFOUND Then
retval = NoAutoChk
End If
End If
dbnavfetch_xEmailInvStmt = retval
End Function
Sub init_xEmailInvStmt(callsetaddr As Integer, callsqlcursor As Integer,
level As Integer)
Dim setaddrlevel As Integer
' initialize null buffer to eliminate Chr$(0) from strings
nxEmailInvStmt.CustID = ""
nxEmailInvStmt.Name = ""
nxEmailInvStmt.BillAttn = ""
nxEmailInvStmt.EmailAddr = ""
nxEmailInvStmt.FileName = ""
nxEmailInvStmt.AdminNo = ""
nxEmailInvStmt.User1 = ""
nxEmailInvStmt.User2 = ""
nxEmailInvStmt.User5 = ""
nxEmailInvStmt.User6 = ""
' filter cursor flags from level for setaddr()
setaddrlevel = level And Not (SqlFastReadOnly Or SqlList Or SqlLock
Or SqlNoList Or SqlNoSelect Or SqlReadOnly Or SqlSingleRow Or SqlSystemDb Or
SqlUpdate)
' call setaddr()
If callsetaddr Then
Call SetAddr(setaddrlevel, "bxEmailInvStmt", bxEmailInvStmt,
nxEmailInvStmt, LenB(bxEmailInvStmt))
End If
' call sqlcursor()
If callsqlcursor Then
If level = SqlReadOnly + NOLEVEL Or level = SqlFastReadOnly
+ NOLEVEL Or level = SqlList + NOLEVEL Then
Call SqlCursorEx(csr_xEmailInvStmt, level,
"csr_xEmailInvStmt", "xEmailInvStmt", "")
Else
Call SqlCursorEx(csr_xEmailInvStmt, level,
"csr_xEmailInvStmt", "xEmailInvStmt", "xEmailInvStmt")
End If
End If
End Sub
Function pvchkfetch_xEmailInvStmt(ctrl As Control, chkstrg As String,
notfoundok As Integer) As Integer
Dim retval As Integer
retval = PVChkFetch1(ctrl, csr_xEmailInvStmt, chkstrg,
bxEmailInvStmt, LenB(bxEmailInvStmt))
If notfoundok Then
If retval = NOTFOUND Then
retval = NoAutoChk
End If
End If
pvchkfetch_xEmailInvStmt = retval
End Function
Function sfetch_xEmailInvStmt() As Integer
sfetch_xEmailInvStmt = SFetch1(csr_xEmailInvStmt, bxEmailInvStmt,
LenB(bxEmailInvStmt))
End Function
Sub sinsert_xEmailInvStmt()
Call SInsert1(csr_xEmailInvStmt, "xEmailInvStmt", bxEmailInvStmt,
LenB(bxEmailInvStmt))
End Sub
Function sqlfetch_xEmailInvStmt(sqlstmt As String) As Integer
sqlfetch_xEmailInvStmt = SqlFetch1(csr_xEmailInvStmt, sqlstmt,
bxEmailInvStmt, LenB(bxEmailInvStmt))
End Function
Sub supdate_xEmailInvStmt()
Call SUpdate1(csr_xEmailInvStmt, "xEmailInvStmt", bxEmailInvStmt,
LenB(bxEmailInvStmt))
End Sub
'*****Program record insert*****
Call TranBeg(True)
'initialize cursor
err_xEmailInvStmt = sqlfetch_xEmailInvStmt("Select *
from xEmailInvStmt")
'insert into db table xEmailInvStmt
'clear buffer
bxEmailInvStmt = nxEmailInvStmt
'bxEmailInvStmt.VerID = 0
bxEmailInvStmt.CustID = bCustomer.CustID
bxEmailInvStmt.Name = bCustomer.BillName
bxEmailInvStmt.BillAttn = bCustomer.BillAttn
bxEmailInvStmt.EmailAddr = vEmailAddr
bxEmailInvStmt.FileName = FileName
bxEmailInvStmt.DocType = 2
bxEmailInvStmt.Status = "0"
If vDocbal <= 10 Then
bxEmailInvStmt.BelowAmtMin = 1
Else
bxEmailInvStmt.BelowAmtMin = 0
End If
bxEmailInvStmt.AdminNo = " "
bxEmailInvStmt.CustStatFlag = 0
bxEmailInvStmt.DateSent = bCustomer.User8
sqlstr = "Select * from xt_x0col_pdf where custid = " +
SParm(bCustomer.CustID)
serr1 = SqlFetch1(csr_xt_x0col_pdf, sqlstr,
bxt_x0col_pdf, LenB(bxt_x0col_pdf))
Do While serr1 <> NOTFOUND
If Trim(bxt_x0col_pdf.AdminNo) > "" Then
bxEmailInvStmt.AdminNo = bxt_x0col_pdf.AdminNo
End If
If bxt_x0col_pdf.CustStatFlag > 0 Then
bxEmailInvStmt.CustStatFlag =
bxt_x0col_pdf.CustStatFlag
End If
serr1 = SFetch1(csr_xt_x0col_pdf, bxt_x0col_pdf,
LenB(bxt_x0col_pdf))
Loop
Call sinsert_xEmailInvStmt
Call TranEnd
*This post is locked for comments