PDA

View Full Version : Store into Sqlserver


Enrique
3rd March 2007, 03:12 AM
Hello, im trying to use the google script in a previous post. But i want to store into sqlserver, not in mysql.

The table in the database is created.

Here is my code

******************
# uncomment logger on during development

#<Logger File>
# Level debug
# Global
# FileName deb.log
#</Logger>

<Action SaveDbRow>
# Optional tells the system that if database insert
# fails, script can continue execution
Optional

#defines name of action
Name saveRow

#database server name
Server localhost

#database type, use any adodb driver for example postgres
DBType mssql

#Database name
Database cienciaviva

Username xxx
Password xxx

#store data to table with name accesslog
TableName google_search

#Primary columns separated by comma
Primary url

Mode insert

#define mapping between column names and matched variable names
ColumnDef url, $link
ColumnDef title, $title
</Action>

<Section>
Name main

<Action ContentURL>
URL http://www.google.com/search?hl=en&lr=&q=unit+miner&btnG=Search
RemoveNewLine
TagsToStrip br,nobr,b
</Action>

<Section While>
# match entry
<Pattern>
RegExp <a href={$link}>{$title}</a><font*>{$desc}
</Pattern>

# save data into database
Action saveRow
</Section>

</Section>

Main main
*****************

jperdoch
14th March 2007, 08:43 PM
Dear Enrique,
can you use Logger in script and send us log file? Because it's very difficult to find problem without any error message. Thanks.