Anyone speak ASP?
...and if wo, can you tell me what's wrong?
set conn = server.createobject("ADODB.Connection") 'establish ODBC connection
conn.CursorLocation = adUseClient
conn.open "Surveys"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.CursorType = adOpenKeyset 'so we can add/delete records
RS.LockType = adLockBatchOptimistic 'only lock the records being added/deleted
RS.Open "2005FallSurvey", conn, , , adCmdTable
RS.AddNew 'create a new, blank record
Yeah, I suck at creating these type of connections because I completely fail to understand the logic, which is why for the last survey I went for a username/pass hardcoded into the script, but I know this is the more-used way.
And if there's nothing wrong with the above, then that means there's something wrong with the permissions in SQL Server and THAT is even worse, arg, because that means I have no idea how to set it so that Web scripts can get to it. And I know in that case the first thing someone says is going to be "Have you tried Books Online?" to which my answer is: Yes, and I can't figure out what the hell to search for to give me the answer - they tell me how to grant permissions to specific users, but I can't figure out what user the Web would be. Arg.
nothing gets
telophase crankier than ASP
set conn = server.createobject("ADODB.Connection") 'establish ODBC connection
conn.CursorLocation = adUseClient
conn.open "Surveys"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.CursorType = adOpenKeyset 'so we can add/delete records
RS.LockType = adLockBatchOptimistic 'only lock the records being added/deleted
RS.Open "2005FallSurvey", conn, , , adCmdTable
RS.AddNew 'create a new, blank record
Yeah, I suck at creating these type of connections because I completely fail to understand the logic, which is why for the last survey I went for a username/pass hardcoded into the script, but I know this is the more-used way.
And if there's nothing wrong with the above, then that means there's something wrong with the permissions in SQL Server and THAT is even worse, arg, because that means I have no idea how to set it so that Web scripts can get to it. And I know in that case the first thing someone says is going to be "Have you tried Books Online?" to which my answer is: Yes, and I can't figure out what the hell to search for to give me the answer - they tell me how to grant permissions to specific users, but I can't figure out what user the Web would be. Arg.
nothing gets
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
no subject
no subject
Would SQL Server not like numbers starting a table name or something? Hrrrrgh.
no subject
no subject
no subject
no subject
no subject
(Anonymous) 2005-09-28 09:18 pm (UTC)(link)It's a sample ASP query complete with code and faq. From a neat site with lots of similar little tutorials on this stuff. And, if you need more help, lemme know.
-bink
no subject
From what I can tell, my biggest problem with ASP is that I don't have enough of a handle of what the potential problems are - it could be just about anything. But that's just newbieness - in PHP I'm at the point where, when I get an error, I already know a whole bunch of things it couldn't possibly be, so that reduces the universe of things I have to test. Just haven't got there in ASP yet. XD