Solved

HTTP POST to SQL

Posted on 2014-09-22
7
175 Views
Last Modified: 2014-09-24
Hi, a company wants to send us some data and the only way they can do it is VIA HTTP POST.

What is the easiest way to get this data in to our SQL server, is it also possible to do this with SQL express?
0
Comment
Question by:CaptainGiblets
[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
  • 4
  • 3
7 Comments
 
LVL 11

Accepted Solution

by:
Dany Balian earned 500 total points
ID: 40336834
1. to send this via http post, means you have to have a web server.
2. web servers could be mainly either windows (asp or asp.net depends on the host), or linux (php or any other server side scripting language). Viewing that you want to do this using sql express, means the webserver should be microsoft.
3. here's a short tutorial on how to handle post requests in asp. ASP Forms
4. finally when you receive the data via request.form("fielddatayouwanttoreceive"), you can connect to any database you like (sql express in your case), and store that data.

hope this helps,

regards,

dany
0
 
LVL 6

Author Comment

by:CaptainGiblets
ID: 40336887
So I am going to have to do at least a little bit of coding in ASP?
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40336904
yes definitely! there's no way to do http post except on a web server.. and that involves writing the webserver (either in asp, php, or any other server scripting language).

then, the client has to access that page. so, the page has to be accessible online (if you don't have a webserver, then you have to have a fixed ip on the webserver) and you give that ip to ur client.

hope this clarifies things
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 6

Author Comment

by:CaptainGiblets
ID: 40338731
I have set up an IIS server with ASP and created a test page where I post a simple post and it displays on a webpage fine.

I am now trying to get it to drop this to a CSV however the guides I find on the internet all use code like this

<%
 dim fs,fname
 set fs=Server.CreateObject("Scripting.FileSystemObject")
 set fname=fs.CreateTextFile("c:\test.txt",true)
 fname.WriteLine("Hello World!")
 fname.Close
 set fname=nothing
 set fs=nothing
 %>

When I am trying to run these I get the error message

Compiler Error Message: BC30807: 'Let' and 'Set' assignment statements are no longer supported.
Source Error:
Line 1:  <%
Line 2:  Set fs = CreateObject("Scripting.FileSystemObject")
Line 3:  Set wfile = fs.OpenTextFile("c:\Mydir
 

Is there an easy way to do this? I'm guessing all the guides I find are older code that is no longer supported.
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40340928
just use:
fs=CreateObject("Scripting.FileSystemObject") 

Open in new window

and
wfile = fs.OpenTextFile("c:\Mydir...

Open in new window

without the Set Keywords
0
 
LVL 6

Author Comment

by:CaptainGiblets
ID: 40341019
ARound 3 pages deep in to google i found a page that said "just remove set and let". I seem to have it working now thanks for your help.
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40341035
Great, Glad i could help!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

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