View Full Version : ODBC for 4D


jreckers[at]preplate.com
10-04-2005, 04:40 AM
Hello,
I am a newbie, and would like to know how to get data entered from a
form on my web site(aspx) into a 4D Database (6.0.6). The page is done
in C#, but I dont know how to insert the data thats been entered on the
form.
I am running Win2000 spk4 with 'odbc for 4D Server' on the
webserver, not '4D ODBC', 4D Server 6.0.6. I know I am making comm with
the 4D server, I can see odbc come up in the server window. I am
trying to just get a name in the employee's table, recieve the
following error:

ERROR [42000] [Simba][Simba ODBC Driver]Syntax Error. ERROR [42000]
[Simba][Simba ODBC Driver]INSERT INTO << ???
>>[(EMLOYEES)](EmployeeName) VALUES('joe')

Here's the code, some of it's been deleted for easier viewing, but I
believe this is the guts:

using System;
using System.Data;
using System.Data.Odbc;
using System.Web;
using System.Web.Mail;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;



public class order : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(IsPostBack)
{
//Insert data into db
string connS = "DSN=name;Uid=id;PWD=pwd;";


OdbcConnection odbcConn = new OdbcConnection(connS);





string insertQuery = "INSERT INTO [(EMLOYEES)](EmployeeName)
VALUES('joe')";



OdbcCommand odbcCmd = new OdbcCommand(insertQuery, odbcConn);

odbcConn.Open();
odbcCmd.ExecuteNonQuery();

odbcConn.Close();

Response.Write("<h3>Check to see if order is in database. This will
be removed later</h3>.");

Fetch, Rover, Fetch
10-04-2005, 12:53 PM
subscrbe to the "4D iNug"
an email list specifically for 4D
you can subscrbe here:

Overview of Important Email Addresses

The following addresses are used to manage and operate these lists:

1. requests[at]lists.4Dinug.org with the command "info 4D_Tech" in the
SUBJECT of the message -- for obtaining this FAQ

2. 4D_Tech-on[at]lists.4Dinug.org, 4D_Biz-on[at]lists.4Dinug.org and
4D_Pub-on[at]lists.4Dinug.org -- for subscribing to the normal version
of these lists

3. 4D_Tech-digest[at]lists.4Dinug.org, 4D_Biz-digest[at]lists.4Dinug.org and
4D_Pub-digest[at]lists.4Dinug.org -- for subscribing to the digest
version of these lists

4. 4D_Tech-off[at]lists.4Dinug.org, 4D_Biz-off[at]lists.4Dinug.org and
4D_Pub-off[at]lists.4Dinug.org -- for unsubscribing from these lists

5. iNUG[at]pdm-inc.com -- for contacting the list admin with your
comments, questions, and problems regarding the mailing lists.