Back to skills
SKILL.md
Odbc
ASecurityR odbc package for ODBC database connections. Use for connecting to any ODBC-compatible database.
- 5 stars
- 0 votes
- 0 copies
- 1 view
- Added June 4, 2026
Works with
Security analysis
100/100npx -y skills add LeoLin990405/r-analytics-skill --skill odbc --agent claude-codeAre you the author of Odbc?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/leolin990405-odbc)---
name: odbc
description: R odbc package for ODBC database connections. Use for connecting to any ODBC-compatible database.
---
# odbc Package
ODBC database connections.
## Connect
```r
library(DBI)
library(odbc)
# DSN connection
con <- dbConnect(odbc(), dsn = "MyDSN")
# Connection string
con <- dbConnect(odbc(),
Driver = "SQL Server",
Server = "server.example.com",
Database = "mydb",
UID = "user",
PWD = "password"
)
# List available drivers
odbcListDrivers()
# List DSNs
odbcListDataSources()
```
## SQL Server
```r
con <- dbConnect(odbc(),
Driver = "ODBC Driver 17 for SQL Server",
Server = "server.example.com",
Database = "mydb",
UID = "user",
PWD = "password",
Port = 1433
)
```
## MySQL/MariaDB
```r
con <- dbConnect(odbc(),
Driver = "MySQL ODBC 8.0 Driver",
Server = "localhost",
Database = "mydb",
UID = "user",
PWD = "password"
)
```
## Basic Operations
```r
# Query
df <- dbGetQuery(con, "SELECT * FROM table")
# Write
dbWriteTable(con, "new_table", df)
# Execute
dbExecute(con, "UPDATE table SET col = 'value'")
```
## Disconnect
```r
dbDisconnect(con)
```
Attribution
Comments
Loading comments…