Hi-
I hope someone can help...
I'm probably missing something VERY basic, but I've looked at this for so long, I just can't spot the problem.
I'm trying to do a simple "Update" sql command with a UX button. In XBasic functions, I wrote the code below.
Using my Alpha sql Connection, "payroll", I want to update all of the "Company" fields (where St_No (Store #) = 43) to "XXX". Then, I have an "alert" to tell the user that "the table has been updated."
I've done this dozens of times before, without difficulty. HOWEVER, this is the first time I'm updating a sql Server 2014 table (my previous times using this type of function for UPDATE and INSERT used "MS Access" tables... don't get mad at me, all of my new applications use "sql Server"). From what I can tell, it doesn't appear that the connection ("payroll") is opening (I AM getting the "alert" message instantly... even though the program doesn't run). There "may" also be a problem with how I'm naming the table: in sql Server, the table is called "dbo.DuplicateFilter", but in Alpha, it's just "DuplicateFilter". Of course, I've tried the code both ways (and many variations of the "UPDATE" code). I NEVER get any sql error messages... just the "alert" message at the end of the code.
I'd appreciate any help or suggestions you have:
function SetTables as c (e as p)
Dim cn as sql::connection
Dim sqlCommand as c
Dim Company as c
Company1 = "XXX"
flag = cn.open("::Name::payroll")
sqlCommand = "UPDATE DuplicateFilter SET Company = Company1 WHERE St_No = 43;"
flag = cn.execute(sqlCommand)
SetTables = "alert('Your tables have been successfully Updated!');"
end function
Thanks,
Phil
I hope someone can help...
I'm probably missing something VERY basic, but I've looked at this for so long, I just can't spot the problem.
I'm trying to do a simple "Update" sql command with a UX button. In XBasic functions, I wrote the code below.
Using my Alpha sql Connection, "payroll", I want to update all of the "Company" fields (where St_No (Store #) = 43) to "XXX". Then, I have an "alert" to tell the user that "the table has been updated."
I've done this dozens of times before, without difficulty. HOWEVER, this is the first time I'm updating a sql Server 2014 table (my previous times using this type of function for UPDATE and INSERT used "MS Access" tables... don't get mad at me, all of my new applications use "sql Server"). From what I can tell, it doesn't appear that the connection ("payroll") is opening (I AM getting the "alert" message instantly... even though the program doesn't run). There "may" also be a problem with how I'm naming the table: in sql Server, the table is called "dbo.DuplicateFilter", but in Alpha, it's just "DuplicateFilter". Of course, I've tried the code both ways (and many variations of the "UPDATE" code). I NEVER get any sql error messages... just the "alert" message at the end of the code.
I'd appreciate any help or suggestions you have:
function SetTables as c (e as p)
Dim cn as sql::connection
Dim sqlCommand as c
Dim Company as c
Company1 = "XXX"
flag = cn.open("::Name::payroll")
sqlCommand = "UPDATE DuplicateFilter SET Company = Company1 WHERE St_No = 43;"
flag = cn.execute(sqlCommand)
SetTables = "alert('Your tables have been successfully Updated!');"
end function
Thanks,
Phil
Comment