Solved

HTML to ACCESS97

Posted on 1997-04-02
5
219 Views
Last Modified: 2013-12-25
How do I send info from received from my page to an ACCESS97 database? Well, could someone give me a start. I know no-CGI. Could someone write a script that I might be able to edit and fill my needs. Basically, 2 drop down boxes, 4 text boxes. Thanks in advance for the help>
0
Comment
Question by:Ntboy69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 1

Expert Comment

by:Fordream
ID: 1827867
It would need custom program or script to do that. Maybe you should make the program or ask others for making it.
0
 

Author Comment

by:Ntboy69
ID: 1827868
Edited text of question
0
 
LVL 1

Expert Comment

by:topaz56
ID: 1827869
Try ACX2Web as the gateway...
It's freeware...
or else pay someone $2-$3K to do it for you
0
 
LVL 1

Expert Comment

by:topaz56
ID: 1827870
Try ACX2Web as the gateway...
It's freeware...
or else pay someone $2-$3K to do it for you
0
 
LVL 1

Accepted Solution

by:
topaz56 earned 100 total points
ID: 1827871
OK...this should get you started...

Here's an example in C++

1st, your web server's OS will need to support ODBC.  If you have an NT based Webserver, you are good to go.  2nd, you will need to setup a 32bit "System" datasource that points to your .mdc database.  Test your ODBC access to the database with a query tool of some sort.  Now you are ready to code an ODBC application to access the data.  Here is a Dynamic SQL function (and a main() shell to call it) that generates a table with the results of the query.  It uses custom "callout" functions to make the detail and table headings of the report customizeable (such as colored text based on value, or italics and bold). Visual C++ 4.2 used to compile the code.
-------------------------------------------------------- Code Starts
#include <Windows.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <ctype.h>
#include "SQL.H"
/* declare odbc function prototypes */
int DynamicSQL(UCHAR * server, UCHAR * uid, UCHAR * pwd, UCHAR *
sqlstr);
#define MAXCOLS 100
UCHAR * data[MAXCOLS]; /* This global variable must be defined with
function */
/* These are global functions for createing customized table output */
int print_err(HDBC hdbc, HSTMT hstmt);
void PrintRptHeadings(void);
void PrintRptDetail(int Field);
void InsertBlankRow(void);

#define CMD_COLOR "#dd5e01"  /* the "CMD,IPD,PPD... are unique to the
application I last used this function for */
#define IPD_COLOR "#0163a0"
#define PPD_COLOR "#8b3626"
#define TPD_COLOR "#018740"
#define FPD_COLOR "#53005c"
#define RED_COLOR "#ff0305"

/* global vars to hold list of cgi vars */
UCHAR RptName[32];
UCHAR Rpt;
int FirstTime;

/* main CGI program */

void main(void)
 .
  FirstTime = 1;
  printf("Content-type: text/html\n\n<title>Customer Survey
Report</title><basefont size=2><CENTER>");  /* output MIME header */
  Rpt = 1;   /* For Headings and Detail Direction */
  DynamicSQL("Surv", "admin", "", "Select QuestionID, QuestionText from
Questions \
order by QuestionID");
  printf ("</CENTER>");
  printf("</html>");
  fflush(stdout);  /* flush standard output */
 .

int print_err(HDBC hdbc, HSTMT hstmt)
 .
        printf("Error, handle this later denny!");
        return (0);
 .
/* Function to print custom headings instead of defaulted column names
*/
void PrintRptHeadings(void)
 .
        switch (Rpt)
        {
                case 0:
                                case 1:
                        break;
                case 2:
                        printf("<td align=center><b>Division</b>");
                        printf("<td align=center><b></b>");
                        printf("<td align=center><b>Name</b>");
                        printf("<td align=center><b>Q: #1</b>");
                        printf("<td align=center><b>Q: #2</b>");
                        printf("<td align=center><b>Q: #3</b>");
                        printf("<td align=center><b>Q: #4</b>");
                        printf("<td align=center><b>Q: #5</b>");
                        printf("<td align=center><b>Q: #6</b>");
                        printf("<td align=center><b>Q: #7</b>");
                        printf("<td align=center><b>Q: #8</b>");
                                        printf("<td
align=center><b>Mailed</b>");
                        break;
                case 3:
                        printf("<td align=center><b>Question</b>");
                        printf("<td align=center><b>Question
Asked</b>");
                        break;

                default:
                        break;
  }
 .
/* Function to print custom detail lines */
void PrintRptDetail(int Field)
 .
        char Percentage[10];
        static char hold_div[10];
        switch (Rpt)
        {
                case 0:    /* Print default */
                        break;
                case 1:    /* Print default */
                        if (strcmp(data[Field], "CMD") == 0)
                        {
                                printf("<td align=center><font size=2
color=%s><b>%s</b>", CMD_COLOR, data[Field]);
                                printf("<font size=2 color=%s><b>,
IPD</b>", IPD_COLOR);
                                printf("<font size=2 color=%s><b>,
FPD</b>", FPD_COLOR);
                                printf("<font size=2 color=%s><b>,
TPD</b>", TPD_COLOR);
                                printf("<font size=2 color=%s><b>,
PPD</b>", PPD_COLOR);
                        }
                        break;
                case 2:    /* First Report Detail Special processing */
                        switch (Field)
                        {
                                case 0: /* Division */
                                        if (strcmp(data[Field],
hold_div) != 0)
                                        {
                                                InsertBlankRow();
                                                if (strcmp(data[Field],
"CMD") == 0)
                                                        printf("<td
align=center><font size=2 color=%s><B>%s</B>", CMD_COLOR, data[Field]);
                                                else if
(strcmp(data[Field], "IPD") == 0)
                                                        printf("<td
align=center><font size=2 color=%s><B>%s</B>", IPD_COLOR, data[Field]);
                                                else if
(strcmp(data[Field], "FPD") == 0)
                                                        printf("<td
align=center><font size=2 color=%s><B>%s</B>", FPD_COLOR, data[Field]);
                                                else if
(strcmp(data[Field], "TPD") == 0)
                                                        printf("<td
align=center><font size=2 color=%s><B>%s</B>", TPD_COLOR, data[Field]);
                                                else if
(strcmp(data[Field], "PPD") == 0)
                                                        printf("<td
align=center><font size=2 color=%s><B>%s</B>", PPD_COLOR, data[Field]);
                                                else
                                                        printf("<td
align=center><font size=2><B>%s</B>", data[Field]);
                                               
strcpy(hold_div,data[Field]);
                                        }
                                        else
                                                printf("<td
align=center><B></B>");
                                        break;
                                case 1:
                                        printf("<td
align=center><B></B>");
                                        break;
                                case 2:
                                case 11:
                                        printf("<td align=left><font
size=2><B>%s</B>", data[Field]);
                                        break;
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                        if (strlen(data[Field]) == 1)
                                        {
                                                strcpy(Percentage,
data[Field]);
                                                strcat(Percentage,
".00");
                                        }
                                        else if (strlen(data[Field]) ==
2)
                                        {
                                                strcpy(Percentage,
data[Field]);
                                                strcat(Percentage,
"00");
                                        }
                                        else if (strlen(data[Field]) ==
3)
                                        {
                                                strcpy(Percentage,
data[Field]);
                                                strcat(Percentage, "0");
                                        }
                                        else if (strlen(data[Field]) ==
4)
                                        {
                                                strcpy(Percentage,
data[Field]);
                                        }
                                        else
                                        {
                                                strncpy(Percentage,
data[Field], 4);
                                                Percentage[4] = 0x00;
                                        }
                                        if (Percentage[0] == '4' ||
Percentage[0] == '5')
                                                printf("<td
align=center><font size=2 color=%s><B>%s</B>", RED_COLOR, Percentage);
                                        else
                                                printf("<td
align=center><B>%s</B>", Percentage);
                                        break;

                                default:
                                        break;
                        }
                        break;
                case 3:    /* First Report Detail Special processing */
                        if (Field)
                                printf("<td align=left><B>%s</B>",
data[Field]);
                        else
                                printf("<td align=center><B>%s</B>",
data[Field]);
                        break;
                default:
                        printf("<td align=center><font
size=2><B>%s</B>", data[Field]);
                        break;
        }
 .
void InsertBlankRow(void)  /* This is for control breaks */
 .
printf("<tr><td><td><td><td><td><td><td><td><td><td><td><td><tr>");
 .

---------------------------------------------------- Code Ends
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question