I'm starting to study team developer ... I have a question ... I have a form with a data field (name) and a button. In the sql server I have a database called test and a table named table1 with a column (names). I want when the user clicks the button, the system saves as a record in the sql server.
I also want to know a way to bring the sql server names field to my application.
I suggest to install samples. Installer is downloadable from OpentText- same place where u got TD.
In folder Samples\Connectivity\SQLServer u can find way to connect to sqlserver.
Another great place where u can find a lot of information is here:
https://wiki.tdcommunity.net/index.php?title=Main_Page and another samples
To connect to sqlserver i suggest here another way- use udl:
You need to install SQLNativeClient: https://www.google.ee/search?q=sqlncli1 ... e&ie=UTF-8
Provider=SQLNCLI11.1;Persist Security Info=False;User ID=USERNAME;Password=PASSWORD;Initial Catalog=DATABASE;Data Source=HOST;Trusted_Connection=No;MARS Connection=True;'
If NOT SqlConnect( hMSSql )
Set sError='Error:NO Connect'
! and next do what u need to do:
If SqlPrepareAndExecute(hMSSql,'SELECT ... FROM ... WHERE ... INTO :.., ;.. ')
If SqlPrepareAndExecute(hMSSql,'INSERT INTO (...) VALUES (...)')
If SqlPrepareAndExecute(hMSSql,'UPDATE TBNAME SET ..., ... WHERE ...')
!And ofcouse - dont mis to commit/ rollback and disconnect asap.
Call SqlCommit( hMSSql )
Call SqlDisconnect(hMSSql )
Who is online
Users browsing this forum: [Ccbot] and 0 guests