?
Solved

HTTP POST to SQL

Posted on 2014-09-22
7
Medium Priority
?
194 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 2000 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

752 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